Home | History | Annotate | Download | only in layout
      1 //  2016 and later: Unicode, Inc. and others.
      2 // License & terms of use: http://www.unicode.org/copyright.html#License
      3 /*
      4  *******************************************************************************
      5  * Copyright (C) 1998-2004, International Business Machines Corporation and    *
      6  * others. All Rights Reserved.                                                *
      7  *******************************************************************************
      8  *
      9  * Created on Dec 09, 2003
     10  *
     11  *******************************************************************************
     12  */
     13 package com.ibm.icu.dev.tool.layout;
     14 
     15 import java.io.PrintStream;
     16 
     17 public class ThaiStateTransition
     18 {
     19     int nextState;
     20     char action;
     21 
     22     public ThaiStateTransition(int nextState, char action)
     23     {
     24         this.nextState = nextState;
     25         this.action = action;
     26     }
     27 
     28     public final int getNextState()
     29     {
     30         return nextState;
     31     }
     32 
     33     public final char getAction()
     34     {
     35         return action;
     36     }
     37 
     38     public final void setNextState(int newNextState)
     39     {
     40         nextState = newNextState;
     41     }
     42 
     43     public final void setAction(char newAction)
     44     {
     45         action = newAction;
     46     }
     47 
     48     public String toString()
     49     {
     50         return ((nextState < 10) ? "0" : "") + nextState + "/" + action + " ";
     51     }
     52 
     53     public void write(PrintStream output)
     54     {
     55         output.print("{");
     56 
     57         if (nextState < 10) {
     58             output.print(" ");
     59         }
     60 
     61         output.print(nextState);
     62 
     63         output.print(", t");
     64         output.print(action);
     65         output.print("}");
     66     }
     67 
     68 }
     69