com.inxar.syntacs.util
Class BitSetIntSet

java.lang.Object
  |
  +--com.inxar.syntacs.util.BitSetIntSet
All Implemented Interfaces:
Cloneable, IntSet

public class BitSetIntSet
extends Object
implements IntSet

Concrete implementation of IntSet which uses a java.util.BitSet internally.


Constructor Summary
BitSetIntSet()
          Constructs the BitSetIntSet with a default initial length of 17.
BitSetIntSet(int length)
          Constructs the BitSetIntSet with the given initial length.
 
Method Summary
 Object clone()
          Clones the IntSet.
 boolean contains(int value)
          Returns true if the given value is already in this IntSet.
 boolean equals(Object other)
           
 int hashCode()
           
 boolean isEmpty()
          Returns true if there are no members in this IntSet (the empty set).
 IntIterator iterator()
          Returns an IntIterator view of the members in the IntSet.
 void put(int value)
          Puts the given int value in the IntSet.
 void put(IntIterator iter)
           
 int size()
          Returns the number of members in this IntSet.
 IntArray toIntArray()
          Returns the list of set members as an IntArray.
 String toString()
           
 void union(IntSet other)
          All the members of the given other IntSet are added to this IntSet.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitSetIntSet

public BitSetIntSet()
Constructs the BitSetIntSet with a default initial length of 17.

BitSetIntSet

public BitSetIntSet(int length)
Constructs the BitSetIntSet with the given initial length.
Method Detail

contains

public boolean contains(int value)
Description copied from interface: IntSet
Returns true if the given value is already in this IntSet.
Specified by:
contains in interface IntSet

isEmpty

public boolean isEmpty()
Description copied from interface: IntSet
Returns true if there are no members in this IntSet (the empty set).
Specified by:
isEmpty in interface IntSet

put

public void put(int value)
Description copied from interface: IntSet
Puts the given int value in the IntSet.
Specified by:
put in interface IntSet

put

public void put(IntIterator iter)

union

public void union(IntSet other)
Description copied from interface: IntSet
All the members of the given other IntSet are added to this IntSet.
Specified by:
union in interface IntSet

iterator

public IntIterator iterator()
Description copied from interface: IntSet
Returns an IntIterator view of the members in the IntSet.
Specified by:
iterator in interface IntSet

size

public int size()
Description copied from interface: IntSet
Returns the number of members in this IntSet.
Specified by:
size in interface IntSet

equals

public boolean equals(Object other)
Overrides:
equals in class Object

toIntArray

public IntArray toIntArray()
Description copied from interface: IntSet
Returns the list of set members as an IntArray.
Specified by:
toIntArray in interface IntSet

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from interface: IntSet
Clones the IntSet.
Specified by:
clone in interface IntSet