Package monq.jfa

Class NfaState<T>

java.lang.Object
monq.jfa.NfaState<T>

public final class NfaState<T> extends Object
  • Constructor Details

    • NfaState

      public NfaState()
    • NfaState

      public NfaState(T a)
  • Method Details

    • isRelevantInEclosure

      public boolean isRelevantInEclosure()

      This state is relevant for an epsilon closure, if it has non-epsilon transitions or if it has a value.

      Non-relevant states are kind of non-front states of the graph in an epsilon closure, meaning only epsilon transitions go to other states of the epsilon closure, so if they not even have a value, they carry no relevant information for the epsilon closure for which outgoing character transitions and values are relevant.

    • epsSize

      public int epsSize()
      number of epsilon transitions going out from this state
    • removeEps

      public void removeEps(Predicate<NfaState<T>> removeIf)
    • addEps

      public void addEps(NfaState<T> state)
    • addEps

      public void addEps(NfaState<T> state1, NfaState<T> state2)
    • addEpsFrom

      public void addEpsFrom(NfaState<T> other)
    • getTrans

      public CharTrans<NfaState<T>> getTrans()
    • setTrans

      public void setTrans(CharTrans<NfaState<T>> trans)
      Sets the transition table.
      Parameters:
      trans - the transition table, never null
    • setValue

      public void setValue(T value)
    • getValue

      public T getValue()
    • clearValue

      public void clearValue()
    • follow

      public NfaState<T> follow(char ch)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Force this object to have identity.
      Overrides:
      hashCode in class Object
      Returns:
      the identity hashcode
    • equals

      public boolean equals(Object other)
      Force this object to have identity.
      Overrides:
      equals in class Object
      Returns:
      true, if other==this
    • charChildren

      public Iterable<NfaState<T>> charChildren()
    • epsChildren

      public Iterable<NfaState<T>> epsChildren()
    • allChildren

      public Iterable<NfaState<T>> allChildren()