Package ca.phon.fsa

Class FSAState<T>

java.lang.Object
ca.phon.fsa.FSAState<T>
Type Parameters:
T -

public class FSAState<T> extends Object
  • Constructor Details

    • FSAState

      public FSAState()
      Constructor
  • Method Details

    • getCurrentState

      public String getCurrentState()
    • setCurrentState

      public void setCurrentState(String currentState)
    • getRunningState

      public FSAState.RunningState getRunningState()
    • setRunningState

      public void setRunningState(FSAState.RunningState runningState)
    • getTape

      public T[] getTape()
    • setTape

      public void setTape(T[] tape)
    • getTapeIndex

      public int getTapeIndex()
    • setTapeIndex

      public void setTapeIndex(int tapeIndex)
    • getLookAheadOffset

      public int getLookAheadOffset()
    • setLookAheadOffset

      public void setLookAheadOffset(int lookAheadOffset)
    • getLookBehindOffset

      public int getLookBehindOffset()
    • setLookBehindOffset

      public void setLookBehindOffset(int lookBehindOffset)
    • getMatchedTape

      public T[] getMatchedTape()
    • getGroup

      public T[] getGroup(int grpIdx)
      Get the indicated group.
      Parameters:
      groupIdx -
      Returns:
      the matched contents for the group or null if not found
    • markGroup

      public void markGroup(int groupIndex, int matchLength)
      Sets the given group start index to the current tape index and the group lenth to 1.
      Parameters:
      groupIndex -
    • incrementGroup

      public void incrementGroup(int groupIndex)
      Increment the length of the specified group
      Parameters:
      groupIndex -
    • setGroups

      public void setGroups(int[] groupStarts, int[] groupLengths)
      Set group information
      Parameters:
      groupStarts -
      groupLengths -
      Throws:
      IllegalArgumentException - if the given arrays are not of the same length
    • getGroupStarts

      public int[] getGroupStarts()
      Get group starts
      Returns:
      array of group starts
    • getGroupLengths

      public int[] getGroupLengths()
      Get group lenths
      Returns:
      array of group lengths
    • resetGroupData

      public void resetGroupData()
      Reset group start and length data.
    • numberOfGroups

      public int numberOfGroups()
      The number of groups
      Returns:
      number of groups