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

java.lang.Object
  extended byorg.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.

Author:
Apache Directory Project

Field Summary
private  GrammarAction action
          The action associated to the transition
private  int currentState
          The current state
private  int nextState
          The next state in the grammar
 
Constructor Summary
GrammarTransition(int currentState, int nextState, GrammarAction action)
          Creates a new GrammarTransition object.
 
Method Summary
 GrammarAction getAction()
           
 int getNextState()
           
 boolean hasAction()
          Tells if the transition has an associated action.
 java.lang.String toString(int grammar, IStates statesEnum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextState

private int nextState
The next state in the grammar


action

private GrammarAction action
The action associated to the transition


currentState

private int currentState
The current state

Constructor Detail

GrammarTransition

public GrammarTransition(int currentState,
                         int nextState,
                         GrammarAction action)
Creates a new GrammarTransition object.

Parameters:
currentState - The current transition
nextState - The target state
action - The action to execute. It could be null.
Method Detail

getNextState

public int getNextState()
Returns:
Returns the target state.

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 GrammarAction getAction()
Returns:
Returns the action associated with the transition

toString

public java.lang.String toString(int grammar,
                                 IStates statesEnum)
Parameters:
grammar - The grammar which state we want a String from
Returns:
A representation of the transition as a string.


Copyright © 2003-2006 . All Rights Reserved.