Package net.sf.saxon.om
Class FingerprintedQName
java.lang.Object
net.sf.saxon.om.StructuredQName
net.sf.saxon.om.FingerprintedQName
- All Implemented Interfaces:
NodeName
A QName triple (prefix, URI, local) with the additional ability to hold an integer fingerprint.
The integer fingerprint provides a fast way of checking equality. A FingerprintedQName makes sense
only in the context of a known NamePool, and instances must be compared only if they relate to the
same NamePool. The fingerprint is optional, and is used only if present.
-
Constructor Summary
ConstructorsConstructorDescriptionFingerprintedQName
(String prefix, String uri, String localName) FingerprintedQName
(String prefix, String uri, String localName, int nameCode) -
Method Summary
Modifier and TypeMethodDescriptionint
allocateNameCode
(NamePool pool) Allocate a nameCode from the NamePool (if none has already been allocated).boolean
Compare two StructuredQName values for equality.static FingerprintedQName
fromClarkName
(String expandedName) Make a structuredQName from a Clark nameint
Get the fingerprint of this name if known.int
Get the nameCode of this name if known.boolean
Ask whether this node name representation has a known namecode and fingerprintvoid
setNameCode
(int nameCode) Set the nameCode for this QName.Methods inherited from class net.sf.saxon.om.StructuredQName
computeHashCode, fromLexicalQName, getClarkName, getDisplayName, getLocalPart, getNamespaceBinding, getPrefix, getStructuredQName, getURI, hashCode, isInNamespace, isInSameNamespace, toJaxpQName, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.NodeName
getDisplayName, getLocalPart, getNamespaceBinding, getPrefix, getStructuredQName, getURI, isInNamespace, isInSameNamespace
-
Constructor Details
-
FingerprintedQName
-
FingerprintedQName
-
-
Method Details
-
fromClarkName
Make a structuredQName from a Clark name- Parameters:
expandedName
- the name in Clark notation "{uri}local" if in a namespace, or "local" otherwise. The format "{}local" is also accepted for a name in no namespace.- Returns:
- the constructed StructuredQName
- Throws:
IllegalArgumentException
- if the Clark name is malformed
-
hasFingerprint
public boolean hasFingerprint()Ask whether this node name representation has a known namecode and fingerprint- Specified by:
hasFingerprint
in interfaceNodeName
- Overrides:
hasFingerprint
in classStructuredQName
- Returns:
- true if the methods getFingerprint() and getNameCode() 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:
getFingerprint
in interfaceNodeName
- Overrides:
getFingerprint
in classStructuredQName
- Returns:
- the fingerprint if known; otherwise -1
-
getNameCode
public int getNameCode()Get the nameCode of this name if known. This method should not to any work to allocate a nameCode if none is already available- Specified by:
getNameCode
in interfaceNodeName
- Overrides:
getNameCode
in classStructuredQName
- Returns:
- the fingerprint if known; otherwise -1
-
setNameCode
public void setNameCode(int nameCode) Set the nameCode for this QName. Note that this modifies the FingerprintedQName object and makes it unusable with a different NamePool.- Parameters:
nameCode
- the nameCode associated with this QName by the NamePool
-
allocateNameCode
Allocate a nameCode from the NamePool (if none has already been allocated). Note that this modifies the FingerprintedQName object and makes it unusable with a different NamePool.- Specified by:
allocateNameCode
in interfaceNodeName
- Parameters:
pool
- the namePool- Returns:
- the allocated name code (or the existing namecode if there already was one)
-
equals
Description copied from class:StructuredQName
Compare two StructuredQName values for equality. This compares the URI and local name parts, excluding any prefix- Overrides:
equals
in classStructuredQName
-