Package org.codehaus.mojo.javacc
Class JJDocMojo.GrammarInfoComparator
java.lang.Object
org.codehaus.mojo.javacc.JJDocMojo.GrammarInfoComparator
- All Implemented Interfaces:
Comparator
- Enclosing class:
JJDocMojo
Compares grammar infos using their relative grammar file paths as the sort key.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final JJDocMojo.GrammarInfoComparator
The singleton instance of this comparator. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compares the path of two grammar files lexicographically.Gets the singleton instance of this class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
INSTANCE
The singleton instance of this comparator.
-
-
Constructor Details
-
GrammarInfoComparator
private GrammarInfoComparator()
-
-
Method Details
-
getInstance
Gets the singleton instance of this class.- Returns:
- The singleton instance of this class.
-
compare
Compares the path of two grammar files lexicographically.- Specified by:
compare
in interfaceComparator
- Parameters:
o1
- The first grammar info.o2
- The second grammar info.- Returns:
- A negative integer if the first grammar is considered "smaller", a positive integer if it is considered "greater" and zero otherwise.
-