public class NodeComparator extends Object implements Comparator<MMObjectNode>
| Constructor and Description |
|---|
NodeComparator(List<String> fields)
Simple constructor that uses the default sort order (UP).
|
NodeComparator(List<String> fields,
List<String> sortDirs)
Constructor in which you specify the sort order (UP or DOWN) per field.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(MMObjectNode o1,
MMObjectNode o2)
The two message nodes will be compared using the compare function of
the values of their fields.
|
boolean |
equals(Object obj)
Returns whether another object is equal to this comparator (that is,
compare the same fields in the same order).
|
int |
hashCode()
Returns the comparator's hash code.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final String UP
public static final String DOWN
public NodeComparator(List<String> fields)
fields - the fields on which the message nodes get compared.public int compare(MMObjectNode o1, MMObjectNode o2)
compare in interface Comparator<MMObjectNode>o1 - the first object to compareo2 - the second object to comparepublic boolean equals(Object obj)
equals in interface Comparator<MMObjectNode>equals in class Objectobj - the object to comparetrue if the objects are equalClassCastExceptionpublic int hashCode()
hashCode in class ObjectObject.hashCode()MMBase 1.9-SNAPSHOT - ${javadoctimestamp}