Class GrammarTransition<C extends Asn1Container>
- java.lang.Object
-
- org.apache.directory.api.asn1.ber.grammar.GrammarTransition<C>
-
- Type Parameters:
C- The container type
public class GrammarTransition<C extends Asn1Container> extends Object
Define a transition between two states of a grammar. It stores the next state, and the action to execute while executing the transition.- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description private Action<C>actionThe action associated to the transitionprivate Enum<?>currentStateThe current stateprivate intcurrentTagThe current tagprivate Enum<?>previousStateThe previous state
-
Constructor Summary
Constructors Constructor Description GrammarTransition(Enum<?> previousState, Enum<?> currentState, int currentTag)Creates a new GrammarTransition object.GrammarTransition(Enum<?> previousState, Enum<?> currentState, int currentTag, Action<C> action)Creates a new GrammarTransition object.GrammarTransition(Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag)Creates a new GrammarTransition object.GrammarTransition(Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag, Action<C> action)Creates a new GrammarTransition object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Action<C>getAction()Enum<?>getCurrentState()Enum<?>getPreviousState()booleanhasAction()Tells if the transition has an associated action.StringtoString()
-
-
-
Field Detail
-
action
private Action<C extends Asn1Container> action
The action associated to the transition
-
previousState
private Enum<?> previousState
The previous state
-
currentState
private Enum<?> currentState
The current state
-
currentTag
private int currentTag
The current tag
-
-
Constructor Detail
-
GrammarTransition
public GrammarTransition(Enum<?> previousState, Enum<?> currentState, int currentTag, Action<C> action)
Creates a new GrammarTransition object.- Parameters:
previousState- the previous statecurrentState- The current statecurrentTag- the current TLV's tagaction- The action to execute. It could be null.
-
GrammarTransition
public GrammarTransition(Enum<?> previousState, Enum<?> currentState, int currentTag)
Creates a new GrammarTransition object.- Parameters:
previousState- the previous statecurrentState- The current statecurrentTag- the current TLV's tag
-
GrammarTransition
public GrammarTransition(Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag, Action<C> action)
Creates a new GrammarTransition object.- Parameters:
previousState- the previous statecurrentState- The current statecurrentTag- the current TLV's tagaction- The action to execute. It could be null.
-
GrammarTransition
public GrammarTransition(Enum<?> previousState, Enum<?> currentState, UniversalTag currentTag)
Creates a new GrammarTransition object.- Parameters:
previousState- the previous statecurrentState- The current statecurrentTag- the current TLV's tag
-
-
Method Detail
-
hasAction
public boolean hasAction()
Tells if the transition has an associated action.- Returns:
trueif an action has been associated to the transition
-
getCurrentState
public Enum<?> getCurrentState()
- Returns:
- The current state
-
getPreviousState
public Enum<?> getPreviousState()
- Returns:
- The previous state
-
-