Action.java |
1 /* 2 * Action.java 3 * 4 * Copyright (c) 1998-2005, The University of Sheffield. 5 * 6 * This file is part of GATE (see http://gate.ac.uk/), and is free 7 * software, licenced under the GNU Library General Public License, 8 * Version 2, June1991. 9 * 10 * A copy of this licence is included in the distribution in the file 11 * licence.html, and is also available at http://gate.ac.uk/gate/licence.html. 12 * 13 * Valentin Tablan, October 2000 14 * 15 * $Id: Action.java,v 1.4 2005/01/11 13:51:38 ian Exp $ 16 */ 17 package guk.im; 18 19 20 /** 21 * Defines an action in the FSM of the input method. 22 * An action starts from a state and goes into another one adding perhaps 23 * something to the composed text. 24 * 25 */ 26 public class Action { 27 /** 28 * Constructor. 29 * 30 * @param nextState the state this action goes to. 31 */ 32 public Action(State nextState){ 33 this.next = nextState; 34 composedText = null; 35 } 36 37 /** 38 * Sets the composed text to be added by this action 39 * 40 * @param text 41 */ 42 public void setComposedText(String text){ 43 composedText = text; 44 } 45 46 /** 47 * Gets the composed text added by this action. 48 * 49 */ 50 public String getComposedText(){ 51 return composedText; 52 } 53 54 /** 55 * Gets the state this action leads to. 56 * 57 */ 58 public State getNext(){ 59 return next; 60 } 61 62 /** 63 * The text to be added by this action to the composed text. 64 * 65 */ 66 String composedText; 67 /** 68 * The state this action leads to. 69 * 70 */ 71 State next; 72 }//class Action 73