Package uk.ac.starlink.connect
Class NodeComparator
java.lang.Object
uk.ac.starlink.connect.NodeComparator
- All Implemented Interfaces:
Comparator<Node>
Comparator for nodes. It returns all Branch nodes first, followed
by all Leaf nodes. Within each group, items are ordered alphabetically.
This is a singleton class.
- Since:
- 25 Feb 2005
- Author:
- Mark Taylor (Starlink)
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the collator used to perform alphabetic ordering.static NodeComparatorReturns an instance of this class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Method Details
-
getCollator
Returns the collator used to perform alphabetic ordering. May be overridden to modify behaviour.- Returns:
- collator
-
compare
- Specified by:
comparein interfaceComparator<Node>
-
getInstance
Returns an instance of this class.- Returns:
- sole instance
-