com.inxar.syntacs.util
Class ImmutableIntSet

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

public class ImmutableIntSet
extends Object
implements IntSet

IntSet wrapper implementation which throws UnsupportedMethodOperation exceptions when the set is attempted to be changed.


Constructor Summary
ImmutableIntSet(IntSet set)
          Constructs the ImmutableIntSet wrapping the given set.
 
Method Summary
 Object clone()
          Clones the IntSet.
 boolean contains(int id)
          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 id)
          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

ImmutableIntSet

public ImmutableIntSet(IntSet set)
Constructs the ImmutableIntSet wrapping the given set.
Method Detail

contains

public boolean contains(int id)
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 id)
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)

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

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

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString 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

clone

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