org.inxar.syntacs.util
Interface IntSet

All Superinterfaces:
Cloneable
All Known Implementing Classes:
BitSetIntSet, EmptyIntSet, ImmutableIntSet, ListIntSet, SingletonIntSet

public interface IntSet
extends Cloneable

IntSet abstracts a mathematical set of integers. Sets are generally expected to be Cloneable.


Method Summary
 Object clone()
          Clones the IntSet.
 boolean contains(int value)
          Returns true if the given value is already in this IntSet.
 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.
 int size()
          Returns the number of members in this IntSet.
 IntArray toIntArray()
          Returns the list of set members as an IntArray.
 void union(IntSet other)
          All the members of the given other IntSet are added to this IntSet.
 

Method Detail

put

public void put(int value)
Puts the given int value in the IntSet.

iterator

public IntIterator iterator()
Returns an IntIterator view of the members in the IntSet.

union

public void union(IntSet other)
All the members of the given other IntSet are added to this IntSet.

isEmpty

public boolean isEmpty()
Returns true if there are no members in this IntSet (the empty set).

size

public int size()
Returns the number of members in this IntSet.

contains

public boolean contains(int value)
Returns true if the given value is already in this IntSet.

toIntArray

public IntArray toIntArray()
Returns the list of set members as an IntArray.

clone

public Object clone()
             throws CloneNotSupportedException
Clones the IntSet.