jds.collection
Class BitSet
java.lang.Object
|
+--jds.collection.BitSet
- public class BitSet
- extends java.lang.Object
- implements java.io.Serializable
BitSet - set of positive integer values;
for use with book
Classic Data Structures
in Java
by Timothy A Budd,
published by Addison-Wesley, 2001.
- See Also:
Collection
, Serialized Form
Constructor Summary |
BitSet(int size)
initialize newly created bitset |
Method Summary |
void |
and(BitSet set)
combine bitset with another bitset |
void |
andNot(BitSet set)
|
void |
clear(int indx)
clear bit value at given index |
boolean |
get(int indx)
get bit value at given index |
void |
or(BitSet set)
combine bitset with another bitset |
void |
set(int indx)
set bit value at given index |
void |
xor(BitSet set)
|
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
BitSet
public BitSet(int size)
- initialize newly created bitset
- Parameters:
size
- maximum bit index value
clear
public void clear(int indx)
- clear bit value at given index
- Parameters:
indx
- position of value to be cleared
get
public boolean get(int indx)
- get bit value at given index
- Parameters:
indx
- position of value to be acessed- Returns:
- true if bit is set, false otherwise
set
public void set(int indx)
- set bit value at given index
- Parameters:
indx
- position of value to be set
and
public void and(BitSet set)
- combine bitset with another bitset
- Parameters:
set
- the second set, corresponding values are anded
andNot
public void andNot(BitSet set)
or
public void or(BitSet set)
- combine bitset with another bitset
- Parameters:
set
- the second set, corresponding values are ored
xor
public void xor(BitSet set)