01 package gate.creole.morph;
02
03 import java.util.ArrayList;
04
05 public class FSMState {
06 private CharMap transitionFunction = new CharMap();
07 public static final byte CHILD_STATE = 0;
08 public static final byte ADJ_STATE = 1;
09 private int index = 0;
10 private ArrayList rhses = new ArrayList();
11
12 public FSMState(int index) {
13 this.index = index;
14 }
15
16 public int getIndex() {
17 return this.index;
18 }
19
20 public FSMState next(char ch, byte type) {
21 return transitionFunction.get(ch, type);
22 }
23
24 public void put(char chr, FSMState state, byte type) {
25 transitionFunction.put(chr, state, type);
26 }
27
28 public ArrayList getRHSes() {
29 return rhses;
30 }
31
32 public void addRHS(RHS rhs) {
33 if(!rhses.contains(rhs))
34 rhses.add(rhs);
35 }
36
37 public CharMap getTransitionFunction() {
38 return transitionFunction;
39 }
40
41 }
|