Package org.apache.xalan.xsltc.dom
Class BitArray
- java.lang.Object
-
- org.apache.xalan.xsltc.dom.BitArray
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable
public class BitArray extends java.lang.Object implements java.io.Externalizable- Author:
- Morten Jorgensen
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BitArraycloneArray()int[]data()Returns the integer array in which the bit array is containedbooleangetBit(int bit)Returns true if the given bit is setintgetBitNumber(int pos)intgetMask()See setMask()intgetNextBit(int startBit)Returns the next set bit from a given positionBitArraymerge(BitArray other)Merge two bit arrays.voidreadExternal(java.io.ObjectInput in)Read the whole tree from a file (serialized)voidresize(int newSize)Resizes the bit array - try to avoid using this method!!!voidsetBit(int bit)Sets a given bitvoidsetMask(int mask)Set the mask for this bit array.intsize()Returns the size of this bit array (in bits).voidwriteExternal(java.io.ObjectOutput out)
-
-
-
Method Detail
-
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
public final BitArray merge(BitArray other)
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
public BitArray cloneArray()
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionRead the whole tree from a file (serialized)- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
-