Package net.sf.saxon.om
Class CodedName
java.lang.Object
net.sf.saxon.om.CodedName
- All Implemented Interfaces:
IdentityComparable,NodeName
An implementation of NodeName that encapsulates an integer fingerprint, a string prefix, and a reference to the NamePool from which
the fingerprint was allocated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.Get the display name, that is the lexical QName in the form [prefix:]local-partintGet the fingerprint of this name if known.Get the local part of the QNameGet aNamespaceBindingwhose (prefix, uri) pair are the prefix and URI of this node nameGet the namespace URI of the QName.Get the prefix of the QName.Get the name in the form of a StructuredQNamebooleanAsk whether this node name representation has a known fingerprintinthashCode()Returns a hash code value for the object.booleanhasURI(NamespaceUri ns) Test whether this name is in a given namespaceintGet a hashCode that offers the guarantee that if A.isIdentical(B), then A.identityHashCode() == B.identityHashCode()booleanisIdentical(IdentityComparable other) Determine whether two IdentityComparable objects are identical.intobtainFingerprint(NamePool namePool) Get the nameCode of this name, allocating a new code from the namepool if necessarytoString()The toString() method returns the value of getDisplayName(), that is, the lexical QName
-
Constructor Details
-
CodedName
-
-
Method Details
-
getPrefix
Get the prefix of the QName. -
getNamespaceUri
Get the namespace URI of the QName.- Specified by:
getNamespaceUriin interfaceNodeName- Returns:
- the URI. Returns the empty string to represent the no-namespace
-
getLocalPart
Get the local part of the QName- Specified by:
getLocalPartin interfaceNodeName- Returns:
- the local part of the QName
-
getDisplayName
Get the display name, that is the lexical QName in the form [prefix:]local-part- Specified by:
getDisplayNamein interfaceNodeName- Returns:
- the lexical QName
-
getStructuredQName
Get the name in the form of a StructuredQName- Specified by:
getStructuredQNamein interfaceNodeName- Returns:
- the name in the form of a StructuredQName
-
hasURI
Test whether this name is in a given namespace -
getNamespaceBinding
Get aNamespaceBindingwhose (prefix, uri) pair are the prefix and URI of this node name- Specified by:
getNamespaceBindingin interfaceNodeName- Returns:
- the corresponding NamespaceBinding
-
hasFingerprint
public boolean hasFingerprint()Ask whether this node name representation has a known fingerprint- Specified by:
hasFingerprintin interfaceNodeName- Returns:
- true if the method getFingerprint() will return a result other than -1
-
getFingerprint
public int getFingerprint()Get the fingerprint of this name if known. This method should not to any work to allocate a fingerprint if none is already available- Specified by:
getFingerprintin interfaceNodeName- Returns:
- the fingerprint if known; otherwise -1
-
obtainFingerprint
Get the nameCode of this name, allocating a new code from the namepool if necessary- Specified by:
obtainFingerprintin interfaceNodeName- Parameters:
namePool- the NamePool used to allocate the name- Returns:
- a nameCode for this name, newly allocated if necessary
-
hashCode
public int hashCode()Returns a hash code value for the object. -
equals
Indicates whether some other object is "equal to" this one. -
isIdentical
Description copied from interface:IdentityComparableDetermine whether two IdentityComparable objects are identical. This is a stronger test than equality (even schema-equality); for example two dateTime values are not identical unless they are in the same timezone.- Specified by:
isIdenticalin interfaceIdentityComparable- Parameters:
other- the value to be compared with- Returns:
- true if the two values are identical, false otherwise
-
identityHashCode
public int identityHashCode()Get a hashCode that offers the guarantee that if A.isIdentical(B), then A.identityHashCode() == B.identityHashCode()- Specified by:
identityHashCodein interfaceIdentityComparable- Returns:
- a hashCode suitable for use when testing for identity.
-
toString
The toString() method returns the value of getDisplayName(), that is, the lexical QName
-