com.sun.labs.minion.indexer.entry
Class EntrySizeComparator
java.lang.Object
com.sun.labs.minion.indexer.entry.EntrySizeComparator
- All Implemented Interfaces:
- java.util.Comparator
public class EntrySizeComparator
- extends java.lang.Object
- implements java.util.Comparator
A class that can be used to compare terms based upon the number of IDs
that are in their postings lists.
Method Summary |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two terms based on the number of IDs that are associated
with them. |
boolean |
equals(java.lang.Object object)
Determines whether two terms have the same number of IDs associated
with them. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntrySizeComparator
public EntrySizeComparator()
equals
public boolean equals(java.lang.Object object)
- Determines whether two terms have the same number of IDs associated
with them.
- Specified by:
equals
in interface java.util.Comparator
- Overrides:
equals
in class java.lang.Object
- Parameters:
object
- another Term
.
- Returns:
true
if the terms contain the same number of
IDs, false
otherwise.
compare
public int compare(java.lang.Object o1,
java.lang.Object o2)
- Compares two terms based on the number of IDs that are associated
with them.
- Specified by:
compare
in interface java.util.Comparator
- Parameters:
o1
- A term.o2
- Another term.
- Returns:
- A value less than, greater than, or equal to 0 if
o1
has less, more, or the same number of terms