org.apache.directory.api.asn1.ber.grammar
Class GrammarTransition<C extends Asn1Container>

java.lang.Object
  extended by org.apache.directory.api.asn1.ber.grammar.GrammarTransition<C>

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

Constructor Summary
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
 Action<C> getAction()
           
 Enum<?> getCurrentState()
           
 Enum<?> getPreviousState()
           
 boolean hasAction()
          Tells if the transition has an associated action.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GrammarTransition

public GrammarTransition(Enum<?> previousState,
                         Enum<?> currentState,
                         int currentTag,
                         Action<C> action)
Creates a new GrammarTransition object.

Parameters:
previousState - the previous state
currentState - The current state
currentTag - the current TLV's tag
action - 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 state
currentState - The current state
currentTag - 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 state
currentState - The current state
currentTag - the current TLV's tag
action - 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 state
currentState - The current state
currentTag - the current TLV's tag
Method Detail

hasAction

public boolean hasAction()
Tells if the transition has an associated action.

Returns:
true if an action has been associated to the transition

getAction

public Action<C> getAction()
Returns:
Returns the action associated with the transition

getCurrentState

public Enum<?> getCurrentState()
Returns:
The current state

getPreviousState

public Enum<?> getPreviousState()
Returns:
The previous state

toString

public String toString()
Overrides:
toString in class Object
Returns:
A representation of the transition as a string.


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.