laser.regularlanguage.fsa
Class DFATransitionTable<L extends LabelInterface>

java.lang.Object
  extended by laser.regularlanguage.fsa.AbstractFSATransitionTable<L>
      extended by laser.regularlanguage.fsa.DFATransitionTable<L>
Type Parameters:
L - The type of Label associated with the FSA that this table is associated with.
All Implemented Interfaces:
java.io.Serializable

public class DFATransitionTable<L extends LabelInterface>
extends AbstractFSATransitionTable<L>

A helper class for RunnableDFAs that allows computation to be performed on them.

Note that this class is not synchronized, and attempts to use it with non-sequential code may result in unexpected behavior.

Author:
Nathan Jokel (laser-software@cs.umass.edu)
See Also:
RunnableFSAInterface.runForwards(java.util.SortedSet>, L), Serialized Form

Field Summary
protected  java.util.Map<?,?>[] _sourceIndex
          The top level of a two level index that returns the target states of all transitions with a given source state and Label.
 
Constructor Summary
protected DFATransitionTable(AbstractRunnableFSA<L> dfa)
          Creates a new DFATransitionTable for the specified runnable DFA.
 
Method Summary
protected  java.util.SortedSet<FSAStateInterface<L>> epsilonClosure(FSAStateInterface<L> state)
          This method is not supported.
protected  java.util.SortedSet<FSAStateInterface<L>> moveClosure(FSAStateInterface<L> state, L label)
          A helper method for the RunnableFSAInterface.runForwards(SortedSet, LabelInterface) method that deals with label transitions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_sourceIndex

protected java.util.Map<?,?>[] _sourceIndex
The top level of a two level index that returns the target states of all transitions with a given source state and Label. This level of the index maps the source state (indexed by its ID) to the second level of the index. The second level of the index maps the Label to the set of target states.

Constructor Detail

DFATransitionTable

protected DFATransitionTable(AbstractRunnableFSA<L> dfa)
Creates a new DFATransitionTable for the specified runnable DFA. This constructor should not be called except by a constructor of RunnableDFA.

Preconditions: dfa is not null.

Parameters:
dfa - The runnable DFA.
Method Detail

epsilonClosure

protected java.util.SortedSet<FSAStateInterface<L>> epsilonClosure(FSAStateInterface<L> state)
This method is not supported.

Specified by:
epsilonClosure in class AbstractFSATransitionTable<L extends LabelInterface>
Throws:
java.lang.UnsupportedOperationException - this method is not supported.
See Also:
RunnableFSA.getInitialConfigurationForwards()

moveClosure

protected java.util.SortedSet<FSAStateInterface<L>> moveClosure(FSAStateInterface<L> state,
                                                                L label)
A helper method for the RunnableFSAInterface.runForwards(SortedSet, LabelInterface) method that deals with label transitions.

Precondition: state and label must not be null, state must be a state in the FSA, label must be a Label in the Alphabet of the FSA.

Specified by:
moveClosure in class AbstractFSATransitionTable<L extends LabelInterface>
See Also:
AbstractRunnableFSA.runForwards(java.util.SortedSet>, L)