com.inxar.syntacs.util
Class ListIntSet

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

public class ListIntSet
extends Object
implements IntSet

Concrete implementation of IntSet which uses a linked list internally.


Constructor Summary
ListIntSet()
          Constructs the ListIntSet.
 
Method Summary
 Object clone()
          Clones the IntSet.
 boolean contains(int val)
          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 val)
          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.
 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

ListIntSet

public ListIntSet()
Constructs the ListIntSet.
Method Detail

contains

public boolean contains(int val)
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 val)
Description copied from interface: IntSet
Puts the given int value in the IntSet.
Specified by:
put 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

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

toIntArray

public IntArray toIntArray()
Description copied from interface: IntSet
Returns the list of set members as an IntArray.
Specified by:
toIntArray 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

clone

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