|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.util.HugeBitSet
public final class HugeBitSet
This class implements a BitSet using a segmented array, so that growth to unreasonably huge sizes will not require having enough heap space for two contiguous copies of the bitset (to handle copying upon array growth). Instead, this class adds more segments, so existing segment data does not have to be copied and the size of contiguous heap allocations remains constant instead of growing.
Note that the maximum size of a HugeBitSet is 2**32 - 1 bits.
Constructor Summary | |
---|---|
HugeBitSet()
|
Method Summary | |
---|---|
void |
clear()
Clear all the bits in the HugeBitSet. |
boolean |
clear(int index)
Clear the specified bit in the HugeBitSet. |
boolean |
get(int index)
Test if the specified bit is set in the HugeBitSet. |
boolean |
isSet(int index)
Test if the specified bit is set in the HugeBitSet. |
void |
justSet(int index)
Set the specified bit in the HugeBitSet without returning the former state. |
int |
length()
Get the maximum number of bits currently allocated in this HugeBitSet. |
boolean |
set(int index)
Set the specified bit in the HugeBitSet. |
java.lang.String |
toString()
Generate a String describing this HugeBitSet. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HugeBitSet()
Method Detail |
---|
public boolean set(int index)
index
- zero-based int index of the bit to set
public void justSet(int index)
index
- zero-based int index of the bit to setpublic boolean clear(int index)
index
- zero-based int index of the bit to set
public void clear()
public boolean get(int index)
index
- zero-based index of bit to test
public boolean isSet(int index)
index
- zero-based index of bit to test
public java.lang.String toString()
toString
in class java.lang.Object
public int length()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |