public class BitArray extends Object implements Externalizable
Constructor and Description |
---|
BitArray()
Constructor.
|
BitArray(int size) |
BitArray(int size,
int[] bits) |
Modifier and Type | Method and Description |
---|---|
BitArray |
cloneArray() |
int[] |
data()
Returns the integer array in which the bit array is contained
|
boolean |
getBit(int bit)
Returns true if the given bit is set
|
int |
getBitNumber(int pos) |
int |
getMask()
See setMask()
|
int |
getNextBit(int startBit)
Returns the next set bit from a given position
|
BitArray |
merge(BitArray other)
Merge two bit arrays.
|
void |
readExternal(ObjectInput in)
Read the whole tree from a file (serialized)
|
void |
resize(int newSize)
Resizes the bit array - try to avoid using this method!!!
|
void |
setBit(int bit)
Sets a given bit
|
void |
setMask(int mask)
Set the mask for this bit array.
|
int |
size()
Returns the size of this bit array (in bits).
|
void |
writeExternal(ObjectOutput out) |
public BitArray()
public BitArray(int size)
public BitArray(int size, int[] bits)
public void setMask(int mask)
public int getMask()
public final int size()
public final boolean getBit(int bit)
public final int getNextBit(int startBit)
public final int getBitNumber(int pos)
public final int[] data()
public final void setBit(int bit)
public final BitArray merge(BitArray other)
public final void resize(int newSize)
public BitArray cloneArray()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright © 2018 JBoss by Red Hat. All rights reserved.