

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object structure5.BitSet
public class BitSet
Implementation of a set of numbered bits. This class's interface
differs from the structure.Set
, Bitset
,
and Set
interfaces, so care must be taken to
invoke the proper methods.
structure.CharSet
,
BitSet
Constructor Summary  

BitSet()
Constructs an empty bitset. 

BitSet(int count)
Constructs an empty bitset with potential to hold values between 0..count1. 
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. 
Object 
clone()
Returns a copy of the set. 
boolean 
contains(int i)
Determine if a bit is a member of the set. 
Object 
difference(BitSet other)
Computes the difference between this set and the other. 
boolean 
equals(Object o)
Return true iff this set and o contain the same elements. 
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. 
String 
toString()
Constructs string representing set. 
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 Object clone()
clone
in class Object
public Object union(BitSet other)
other
 The set to be unioned with this.
public Object intersection(BitSet other)
other
 The other set to be intersected with this.public 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(Object o)
equals
in class Object
o
 Another nonnull bitset.
public String toString()
toString
in class Object


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 