public class IndexLineComparator extends Object implements ILineComparator
A comparator that captures the ordering of lines in Wordnet index files
(e.g., index.adv or adv.idx files). These files are
ordered alphabetically.
This class follows a singleton design pattern, and is not intended to be
instantiated directly; rather, call the getInstance() method to get
the singleton instance.
| Modifier | Constructor and Description |
|---|---|
protected |
IndexLineComparator(CommentComparator detector)
This constructor is marked protected so that the class may be
sub-classed, but not directly instantiated.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(String s1,
String s2) |
ICommentDetector |
getCommentDetector()
Returns the comment detector instance associated with this line
comparator, or
null if one does not exist. |
static IndexLineComparator |
getInstance()
Returns the singleton instance of this class, instantiating it if
necessary.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongprotected IndexLineComparator(CommentComparator detector)
getInstance() method.detector - the comment detector for this line comparator, or
null if there is noneNullPointerException - if the specified comment comparator is nullpublic static IndexLineComparator getInstance()
null.null singleton instance of this class,
instantiating it if necessary.public int compare(String s1, String s2)
compare in interface Comparator<String>public ICommentDetector getCommentDetector()
ILineComparatornull if one does not exist.getCommentDetector in interface ILineComparatornull if there is noneCopyright © 2018. All rights reserved.