1 20 21 package org.apache.directory.ldapstudio.dsmlv2; 22 23 24 31 public class GrammarTransition 32 { 33 34 private int nextState; 35 36 37 private GrammarAction action; 38 39 40 private int currentState; 41 42 43 53 public GrammarTransition( int currentState, int nextState, GrammarAction action ) 54 { 55 this.currentState = currentState; 56 this.nextState = nextState; 57 this.action = action; 58 } 59 60 66 public int getNextState() 67 { 68 return nextState; 69 } 70 71 72 79 public boolean hasAction() 80 { 81 return action != null; 82 } 83 84 85 91 public GrammarAction getAction() 92 { 93 return action; 94 } 95 96 97 107 public String toString( int grammar, IStates statesEnum ) 108 { 109 110 StringBuffer sb = new StringBuffer (); 111 112 sb.append( "Transition from <" ).append( statesEnum.getState( currentState ) ).append( "> to <" ).append( 113 statesEnum.getState( nextState ) ).append( ">, action : " ).append( 114 ( ( action == null ) ? "no action" : action.toString() ) ).append( ">" ); 115 116 return sb.toString(); 117 } 118 } | Popular Tags |