|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.BitSet
public class BitSet
Implementation of a set of numbered bits. This class's interface
differs from the Set
, java.util.Bitset
,
and Set
interfaces, so care must be taken to
invoke the proper methods.
CharSet
,
BitSet
Constructor Summary | |
---|---|
BitSet()
Constructs an empty bitset. |
|
BitSet(int count)
Constructs an empty bitset with potential to hold values between 0..count-1. |
Method Summary | |
---|---|
void |
add(int i)
Adds a bit to the bitset, if not already there. |
void |
clear()
Remove all bits from the set. |
void |
clear(int count)
Remove bits from set; set size to count. |
java.lang.Object |
clone()
Returns a copy of the set. |
boolean |
contains(int i)
Determine if a bit is a member of the set. |
java.lang.Object |
difference(BitSet other)
Computes the difference between this set and the other. |
boolean |
equals(java.lang.Object o)
Return true iff this set and o contain the same elements. |
java.lang.Object |
intersection(BitSet other)
Return the intersection of this set and the other. |
boolean |
isEmpty()
Determine if a set is empty. |
void |
remove(int i)
Remove bit i from the bitset. |
boolean |
subset(BitSet other)
Returns true iff this set is a subset of the other. |
java.lang.String |
toString()
Constructs string representing set. |
java.lang.Object |
union(BitSet other)
Compute a new set that is the union of this set and other. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BitSet()
public BitSet(int count)
count
- The number of distinct values possibly in set.Method Detail |
---|
public void add(int i)
i
- The number of the bit to be added.public void remove(int i)
i
- The index of the bit to be removed.public boolean contains(int i)
i
- The bit index of potential bit.
public void clear()
public void clear(int count)
count
- The new capacity of the newly empty set.public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.Object union(BitSet other)
other
- The set to be unioned with this.
public java.lang.Object intersection(BitSet other)
other
- The other set to be intersected with this.public java.lang.Object difference(BitSet other)
other
- The difference between this set and other.public boolean subset(BitSet other)
other
- The potential superset.
public boolean isEmpty()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- Another non-null bitset.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |