public class NodeFieldComparator extends Object implements Comparator<Node>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
ascending |
protected String |
field |
| Constructor and Description |
|---|
NodeFieldComparator(String field)
Basic constructor.
|
NodeFieldComparator(String field,
boolean ascending)
Basic constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compare(Node n1,
Node n2)
Two external source objects are said to be equal only when the two type fields match.
|
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 String field
protected boolean ascending
public NodeFieldComparator(String field)
field - the node field to compare the nodes onpublic NodeFieldComparator(String field, boolean ascending)
field - the node field to compare the nodes onascending - sort the list ascending or descendingpublic int compare(Node n1, Node n2)
Node.compare in interface Comparator<Node>n1 - the first node.n2 - the second nodeComparator.compare(java.lang.Object, java.lang.Object)MMBase 1.9-SNAPSHOT - ${javadoctimestamp}