Package uk.ac.starlink.connect
Class NodeComparator
- java.lang.Object
-
- uk.ac.starlink.connect.NodeComparator
-
- All Implemented Interfaces:
java.util.Comparator<Node>
public class NodeComparator extends java.lang.Object implements java.util.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Node i1, Node i2)
java.text.Collator
getCollator()
Returns the collator used to perform alphabetic ordering.static NodeComparator
getInstance()
Returns an instance of this class.
-
-
-
Method Detail
-
getCollator
public java.text.Collator getCollator()
Returns the collator used to perform alphabetic ordering. May be overridden to modify behaviour.- Returns:
- collator
-
compare
public int compare(Node i1, Node i2)
- Specified by:
compare
in interfacejava.util.Comparator<Node>
-
getInstance
public static NodeComparator getInstance()
Returns an instance of this class.- Returns:
- sole instance
-
-