JFlex
Class StateSet

java.lang.Object
  extended by JFlex.StateSet

public final class StateSet
extends java.lang.Object

A set of NFA states (= integers). Very similar to java.util.BitSet, but is faster and doesn't crash


Field Summary
static StateSet EMPTY
           
 
Constructor Summary
StateSet()
           
StateSet(int size)
           
StateSet(int size, int state)
           
StateSet(StateSet set)
           
 
Method Summary
 void add(StateSet set)
           
 void addState(int state)
           
 void clear()
           
 StateSet complement(StateSet set)
          Returns the set of elements that contained are in the specified set but are not contained in this set.
 boolean containsElements()
           
 boolean containsSet(StateSet set)
           
 StateSet copy()
           
 void copy(StateSet set)
          Copy specified StateSet into this.
 boolean equals(java.lang.Object b)
           
 int getAndRemoveElement()
          Returns one element of the set and removes it.
 int hashCode()
           
 boolean isElement(int state)
           
 void remove(int state)
           
 StateSetEnumerator states()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final StateSet EMPTY
Constructor Detail

StateSet

public StateSet()

StateSet

public StateSet(int size)

StateSet

public StateSet(int size,
                int state)

StateSet

public StateSet(StateSet set)
Method Detail

addState

public void addState(int state)

clear

public void clear()

isElement

public boolean isElement(int state)

getAndRemoveElement

public int getAndRemoveElement()
Returns one element of the set and removes it. Precondition: the set is not empty.


remove

public void remove(int state)

complement

public StateSet complement(StateSet set)
Returns the set of elements that contained are in the specified set but are not contained in this set.


add

public void add(StateSet set)

containsSet

public boolean containsSet(StateSet set)

equals

public boolean equals(java.lang.Object b)
Overrides:
equals in class java.lang.Object
Throws:
java.lang.ClassCastException - if b is not a StateSet
java.lang.NullPointerException - if b is null

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

states

public StateSetEnumerator states()

containsElements

public boolean containsElements()

copy

public StateSet copy()

copy

public void copy(StateSet set)
Copy specified StateSet into this.

Parameters:
set - the state set to copy.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object