com.fasterxml.aalto.in
Class ByteBasedPName

java.lang.Object
  extended by com.fasterxml.aalto.in.PName
      extended by com.fasterxml.aalto.in.ByteBasedPName
Direct Known Subclasses:
PName1, PName2, PName3, PNameN

public abstract class ByteBasedPName
extends PName

This intermediate abstract class defines more specialized API needed by components like symbol tables, which need to provide efficient access to byte-based PNames. Byte-based names can be used to directly convert byte sequences to actual character-based names, without intervening byte-to-character decoding phase.


Field Summary
protected  int mHash
          Since the hash is calculated different from the way eventual String's hash will be (bit faster, not significantly worse hashing uniformness), we need to store that hash here.
 
Fields inherited from class com.fasterxml.aalto.in.PName
_localName, _namespaceBinding, _prefix, _prefixedName
 
Constructor Summary
protected ByteBasedPName(String pname, String prefix, String ln, int hash)
           
 
Method Summary
abstract  boolean equals(int[] quads, int qlen)
           
abstract  boolean equals(int quad1, int quad2)
           
abstract  int getFirstQuad()
           
abstract  int getQuad(int index)
           
 int hashCode()
          Whether we should use internal hash, or the hash of prefixed name string itself is an open question.
abstract  int sizeInQuads()
           
 
Methods inherited from class com.fasterxml.aalto.in.PName
boundEquals, boundEquals, boundHashCode, boundHashCode, constructQName, constructQName, createBoundName, equals, getLastQuad, getLocalName, getNsBinding, getNsUri, getPrefix, getPrefixedName, hasPrefix, hasPrefixedName, isBound, needsBinding, toString, unboundEquals, unboundHashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mHash

protected final int mHash
Since the hash is calculated different from the way eventual String's hash will be (bit faster, not significantly worse hashing uniformness), we need to store that hash here.

Constructor Detail

ByteBasedPName

protected ByteBasedPName(String pname,
                         String prefix,
                         String ln,
                         int hash)
Method Detail

getFirstQuad

public abstract int getFirstQuad()
Specified by:
getFirstQuad in class PName

getQuad

public abstract int getQuad(int index)
Specified by:
getQuad in class PName

sizeInQuads

public abstract int sizeInQuads()
Specified by:
sizeInQuads in class PName

equals

public abstract boolean equals(int quad1,
                               int quad2)

equals

public abstract boolean equals(int[] quads,
                               int qlen)

hashCode

public int 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.

Overrides:
hashCode in class Object


Copyright © 2012 Fasterxml.com. All Rights Reserved.