org.apache.directory.shared.asn1.ber.grammar
Class GrammarTransition

java.lang.Object
  extended by org.apache.directory.shared.asn1.ber.grammar.GrammarTransition

public class GrammarTransition
extends java.lang.Object

Define a transition between two states of a grammar. It stores the next state, and the action to execute while transiting.

Version:
$Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sa, 07 Jun 2008) $
Author:
Apache Directory Project

Constructor Summary
GrammarTransition(int previousState, int currentState, int currentTag, IAction action)
          Creates a new GrammarTransition object.
 
Method Summary
 IAction getAction()
           
 int getCurrentState()
           
 int getPreviousState()
           
 boolean hasAction()
          Tells if the transition has an associated action.
 java.lang.String toString(IStates statesEnum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrammarTransition

public GrammarTransition(int previousState,
                         int currentState,
                         int currentTag,
                         IAction 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.
Method Detail

hasAction

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

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

getAction

public IAction getAction()
Returns:
Returns the action associated with the transition

toString

public java.lang.String toString(IStates statesEnum)
Parameters:
statesEnum - Starting state.
Returns:
A representation of the transition as a string.

getCurrentState

public int getCurrentState()
Returns:
The current state

getPreviousState

public int getPreviousState()
Returns:
The previous state


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.