Top Description Fields Constructors Methods
com.fasterxml.aalto.in

public final Class PNameC

extends PName
Class Inheritance
Imports
com.fasterxml.aalto.impl.ErrorConsts

An alternate implementation of PName: instead of coming straight from byte contents, it is actually just built from a character array.

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.

Field Summary

Modifier and TypeField and Description
protected final 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.

Inherited from com.fasterxml.aalto.in.PName:
_localName_namespaceBinding_prefix_prefixedName

Constructor Summary

AccessConstructor and Description
public
PNameC(String pname, String prefix, String ln, int hash)

Method Summary

Modifier and TypeMethod and Description
public static int
calcHash(char[] buffer, int start, int
Length of String; has to be at least 1 (caller guarantees this pre-condition)
len
)

Implementation of a hashing method for variable length Strings.

public static int
public static PNameC
public static PNameC
construct(String pname, int hash)

public PName
public boolean
equalsPName(char[] buffer, int start, int len, int hash)

public int
public int
public final int
public int
getQuad(int index)

Implements abstract com.fasterxml.aalto.in.PName.getQuad.

public int
hashCode()

Overrides com.fasterxml.aalto.in.PName.hashCode.

Whether we should use internal hash, or the hash of prefixed name string itself is an open question.
public int
sizeInQuads()

Implements abstract com.fasterxml.aalto.in.PName.sizeInQuads.

This method should never get called on instances of this class, so let's throw an exception if that does happen.
Inherited from com.fasterxml.aalto.in.PName:
boundEqualsboundEqualsboundHashCodeboundHashCodeconstructQNameconstructQNameequalsgetLocalNamegetNsBindinggetNsUrigetPrefixgetPrefixedNamehasPrefixhasPrefixedNameisBoundneedsBindingtoStringunboundEqualsunboundHashCode

Field Detail

mHashback to summary
protected final 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.

Constructor Detail

PNameCback to summary
public PNameC(String pname, String prefix, String ln, int hash)

Method Detail

calcHashback to summary
public static int calcHash(char[] buffer, int start, int len)

Implementation of a hashing method for variable length Strings. Most of the time intention is that this calculation is done by caller during parsing, not here; however, sometimes it needs to be done for parsed "String" too.

Parameters
len:int

Length of String; has to be at least 1 (caller guarantees this pre-condition)

calcHashback to summary
public static int calcHash(String key)
constructback to summary
public static PNameC construct(String pname)
constructback to summary
public static PNameC construct(String pname, int hash)
createBoundNameback to summary
public PName createBoundName(NsBinding nsb)

Implements abstract com.fasterxml.aalto.in.PName.createBoundName.

Annotations
@Override
equalsPNameback to summary
public boolean equalsPName(char[] buffer, int start, int len, int hash)
getCustomHashback to summary
public int getCustomHash()
getFirstQuadback to summary
public int getFirstQuad()

Implements abstract com.fasterxml.aalto.in.PName.getFirstQuad.

Annotations
@Override
getLastQuadback to summary
public final int getLastQuad()

Implements abstract com.fasterxml.aalto.in.PName.getLastQuad.

Annotations
@Override
getQuadback to summary
public int getQuad(int index)

Implements abstract com.fasterxml.aalto.in.PName.getQuad.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides com.fasterxml.aalto.in.PName.hashCode.

Whether we should use internal hash, or the hash of prefixed name string itself is an open question. For now, let's use former.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
sizeInQuadsback to summary
public int sizeInQuads()

Implements abstract com.fasterxml.aalto.in.PName.sizeInQuads.

This method should never get called on instances of this class, so let's throw an exception if that does happen.

Annotations
@Override