|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectorg.mmbase.util.NodeComparator
public class NodeComparator
This class implements the Comparator interface for comparing MMObjectNodes. At forehand you specify in which fields a specified nodes should be compared, these fields may not have a null value.
| Field Summary | |
|---|---|
static String |
DOWN
|
static String |
UP
|
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String UP
public static final String DOWN
| Constructor Detail |
|---|
public NodeComparator(List<String> fields)
fields - the fields on which the message nodes get compared.
public NodeComparator(List<String> fields,
List<String> sortDirs)
fields - the fields on which the message nodes get compared.sortDirs - the sort directions (UP or DOWN) for each field.| Method Detail |
|---|
public int compare(MMObjectNode o1,
MMObjectNode o2)
compare in interface Comparator<MMObjectNode>o1 - the first object to compareo2 - the second object to compare
public boolean equals(Object obj)
equals in interface Comparator<MMObjectNode>equals in class Objectobj - the object to compare
true if the objects are equal
ClassCastExceptionpublic int hashCode()
hashCode in class ObjectObject.hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||