com.ctc.wstx.dtd
public final class NameKey extends java.lang.Object implements java.lang.Comparable
One important note about usage is that two of the name components (prefix and local name) HAVE to have been interned some way, as all comparisons are done using identity comparison; whereas URI is NOT necessarily interned.
Note that the main reason this class is mutable -- unlike most key classes -- is that this allows reusing key objects for access, as long as the code using it knows ramifications of trying to modify a key that's used in a data structure.
Note, too, that the hash code is cached as this class is mostly used as a Map key, and hash code is used a lot.
Constructor and Description |
---|
NameKey(java.lang.String prefix,
java.lang.String localName) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object o) |
boolean |
equals(java.lang.Object o) |
java.lang.String |
getLocalName() |
java.lang.String |
getPrefix() |
int |
hashCode() |
boolean |
isaNsDeclaration() |
NameKey |
reset(java.lang.String prefix,
java.lang.String localName) |
java.lang.String |
toString() |
public NameKey reset(java.lang.String prefix, java.lang.String localName)
public java.lang.String getPrefix()
public java.lang.String getLocalName()
public boolean isaNsDeclaration()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable