private static class NameNode.ExactMatchComparator extends java.lang.Object implements java.util.Comparator<NameNode>, java.io.Serializable
NameNodes being compared lexically to match
exactly for the nodes to be reported as equivalent (return value of 0 from compare method). This is used when looking up an unabbreviated
name, or when determining the natural order of name nodes within a Namespace.| Modifier | Constructor and Description |
|---|---|
private |
ExactMatchComparator() |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(NameNode n1,
NameNode n2)
Resolves a comparison of two
NameNode objects. |
public int compare(NameNode n1, NameNode n2)
NameNode objects. After
performing object reference identity check, and null checks, uses an
exact lexical match of the nodes' names to determin equivalence.compare in interface java.util.Comparator<NameNode>n1 - First NameNode for comparison. If
null, -1 is returned.n2 - Second NameNode for comparison. If
null, 1 is returned.0 if objects are considered equal by the rules
of this comparator; -1 if n1 is
considered less than n2; 1 if
n1 is considered greater than n2.