org.enhydra.apache.xerces.validators.common
Class CMStateSet
java.lang.Object
|
+--org.enhydra.apache.xerces.validators.common.CMStateSet
- class CMStateSet
- extends Object
This class is a very simple bitset class. The DFA content model code needs
to support a bit set, but the java BitSet class is way, way overkill. Our
bitset never needs to be expanded after creation, hash itself, etc...
Since the vast majority of content models will never require more than 64
bits, and since allocation of anything in Java is expensive, this class
provides a hybrid implementation that uses two ints for instances that use
64 bits or fewer. It has a byte array reference member which will only be
used if more than 64 bits are required.
Note that the code that uses this class will never perform operations
on sets of different sizes, so that check does not have to be made here.
- Version:
-
Constructor Summary |
(package private) |
CMStateSet(int bitCount)
|
fBitCount
int fBitCount
fByteCount
int fByteCount
fBits1
int fBits1
fBits2
int fBits2
fByteArray
byte[] fByteArray
CMStateSet
CMStateSet(int bitCount)
throws CMException
toString
public String toString()
- Overrides:
toString
in class Object
intersection
final void intersection(CMStateSet setToAnd)
getBit
final boolean getBit(int bitToGet)
throws CMException
isEmpty
final boolean isEmpty()
isSameSet
final boolean isSameSet(CMStateSet setToCompare)
union
final void union(CMStateSet setToOr)
setBit
final void setBit(int bitToSet)
throws CMException
setTo
final void setTo(CMStateSet srcSet)
throws CMException
zeroBits
final void zeroBits()
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 1999 The Apache Software Foundation. All Rights reserved.