Package org.apache.xalan.xsltc.dom
Class BitArray
java.lang.Object
org.apache.xalan.xsltc.dom.BitArray
- All Implemented Interfaces:
Externalizable
,Serializable
- Author:
- Morten Jorgensen
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int[]
data()
Returns the integer array in which the bit array is containedfinal boolean
getBit
(int bit) Returns true if the given bit is setfinal int
getBitNumber
(int pos) int
getMask()
See setMask()final int
getNextBit
(int startBit) Returns the next set bit from a given positionfinal BitArray
Merge two bit arrays.void
Read the whole tree from a file (serialized)final void
resize
(int newSize) Resizes the bit array - try to avoid using this method!!!final void
setBit
(int bit) Sets a given bitvoid
setMask
(int mask) Set the mask for this bit array.final int
size()
Returns the size of this bit array (in bits).void
-
Constructor Details
-
BitArray
public BitArray()Constructor. Defines the initial size of the bit array (in bits). -
BitArray
public BitArray(int size) -
BitArray
public BitArray(int size, int[] bits)
-
-
Method Details
-
setMask
public void setMask(int mask) Set the mask for this bit array. The upper 8 bits of this mask indicate the DOM in which the nodes in this array belong. -
getMask
public int getMask()See setMask() -
size
public final int size()Returns the size of this bit array (in bits). -
getBit
public final boolean getBit(int bit) Returns true if the given bit is set -
getNextBit
public final int getNextBit(int startBit) Returns the next set bit from a given position -
getBitNumber
public final int getBitNumber(int pos) -
data
public final int[] data()Returns the integer array in which the bit array is contained -
setBit
public final void setBit(int bit) Sets a given bit -
merge
Merge two bit arrays. This currently only works for nodes from a single DOM (because there is only one _mask per array). -
resize
public final void resize(int newSize) Resizes the bit array - try to avoid using this method!!! -
cloneArray
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
Read the whole tree from a file (serialized)- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-