Package com.sodius.mdw.server.structure
Class NodeComparator
- java.lang.Object
-
- com.sodius.mdw.server.structure.NodeComparator
-
- All Implemented Interfaces:
Comparator<Node>
public class NodeComparator extends Object implements Comparator<Node>
A node comparison function, which involves comparing the title of the nodes.Clients may subclass this class.
- See Also:
Node.getTitle()
-
-
Constructor Summary
Constructors Constructor Description NodeComparator()
Instantiates a new node comparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Node o1, Node o2)
Compares the two nodes.-
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, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
compare
public int compare(Node o1, Node o2)
Compares the two nodes. Returns a negative integer, zero, or a positive integer as the first node title is less than, equal to, or greater than the second.- Specified by:
compare
in interfaceComparator<Node>
- Parameters:
o1
- the first node to be compared.o2
- the second node to be compared.- Returns:
- a negative integer, zero, or a positive integer as the first node title is less than, equal to, or greater than the second.
-
-