|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.mit.jwi.data.compare.IndexLineComparator
public class IndexLineComparator
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.
Constructor Summary | |
---|---|
protected |
IndexLineComparator(CommentComparator detector)
This constructor is marked protected so that the class may be sub-classed, but not directly instantiated. |
Method Summary | |
---|---|
int |
compare(java.lang.String s1,
java.lang.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. |
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 |
Constructor Detail |
---|
protected IndexLineComparator(CommentComparator detector)
getInstance()
method.
detector
- the comment detector for this line comparator, or
null
if there is none
java.lang.NullPointerException
- if the specified comment comparator is null
Method Detail |
---|
public static IndexLineComparator getInstance()
null
.
null
singleton instance of this class,
instantiating it if necessary.public int compare(java.lang.String s1, java.lang.String s2)
compare
in interface java.util.Comparator<java.lang.String>
public ICommentDetector getCommentDetector()
ILineComparator
null
if one does not exist.
getCommentDetector
in interface ILineComparator
null
if there is none
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |