public final class PNameC extends PName
Note: one unfortunate result of this being a somewhat different PName is that equality comparison between this and other implementations will not work as expected. As such, these should only be used as temporary names.
Modifier and Type | Field and Description |
---|---|
protected int |
mHash
Since the hash may be calculated different from the way eventual
String's hash will be (right now it is not), we better store
"our" hash here.
|
_localName, _namespaceBinding, _prefix, _prefixedName
Constructor and Description |
---|
PNameC(java.lang.String pname,
java.lang.String prefix,
java.lang.String ln,
int hash) |
Modifier and Type | Method and Description |
---|---|
static int |
calcHash(char[] buffer,
int start,
int len)
Implementation of a hashing method for variable length
Strings.
|
static int |
calcHash(java.lang.String key) |
static PNameC |
construct(java.lang.String pname) |
static PNameC |
construct(java.lang.String pname,
int hash) |
PName |
createBoundName(NsBinding nsb) |
boolean |
equalsPName(char[] buffer,
int start,
int len,
int hash) |
int |
getCustomHash() |
int |
getFirstQuad() |
int |
getLastQuad() |
int |
getQuad(int index) |
int |
hashCode()
Whether we should use internal hash, or the hash of prefixed
name string itself is an open question.
|
int |
sizeInQuads()
This method should never get called on instances of this class,
so let's throw an exception if that does happen.
|
boundEquals, boundEquals, boundHashCode, boundHashCode, constructQName, constructQName, equals, getLocalName, getNsBinding, getNsUri, getPrefix, getPrefixedName, hasPrefix, hasPrefixedName, isBound, needsBinding, toString, unboundEquals, unboundHashCode
protected final int mHash
public PNameC(java.lang.String pname, java.lang.String prefix, java.lang.String ln, int hash)
public PName createBoundName(NsBinding nsb)
createBoundName
in class PName
public static PNameC construct(java.lang.String pname)
public static PNameC construct(java.lang.String pname, int hash)
public boolean equalsPName(char[] buffer, int start, int len, int hash)
public int getCustomHash()
public static int calcHash(char[] buffer, int start, int len)
len
- Length of String; has to be at least 1 (caller guarantees
this pre-condition)public static int calcHash(java.lang.String key)
public int sizeInQuads()
sizeInQuads
in class PName
public int getFirstQuad()
getFirstQuad
in class PName
public final int getLastQuad()
getLastQuad
in class PName