java.text
Class WordBreakTable

java.lang.Object
  extended byjava.text.WordBreakTable

final class WordBreakTable
extends Object

This class implements a state transition table. After each transition, using the get method, the new state is returned along with information about the state change (ex. was it a "marked" transition"). This class is internal only.


Field Summary
private  int cols
           
private  byte[] data
           
private static int END_STATE
           
(package private) static byte INDEX_MASK
           
private static int INITIAL_STATE
           
(package private) static byte MARK_MASK
           
 
Constructor Summary
WordBreakTable(int cols, byte[] data)
          Construct a table using existing data.
 
Method Summary
 int get(int oldState, int input)
          Get the resulting state moving from oldState accepting input
 int initialState()
          Get the start state
 boolean isEndState(int state)
          Check is a state is the end state
 boolean isMarkState(int state)
          Checks to see if the transition into the specified state was "marked"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MARK_MASK

static final byte MARK_MASK
See Also:
Constant Field Values

INDEX_MASK

static final byte INDEX_MASK
See Also:
Constant Field Values

INITIAL_STATE

private static final int INITIAL_STATE
See Also:
Constant Field Values

END_STATE

private static final int END_STATE
See Also:
Constant Field Values

data

private byte[] data

cols

private int cols
Constructor Detail

WordBreakTable

public WordBreakTable(int cols,
                      byte[] data)
Construct a table using existing data. See SentenceBreakBoundary and the other SimpleTextBoundary subclasses for examples.

Parameters:
cols - number of columns in the table
data - an encoded byte array containing state and transition data
Method Detail

get

public int get(int oldState,
               int input)
Get the resulting state moving from oldState accepting input

Parameters:
oldState - current state
input - input
Returns:
int resulting state and transition data

isMarkState

public boolean isMarkState(int state)
Checks to see if the transition into the specified state was "marked"

Parameters:
state - the state as returned by get, initialState, or endState
Returns:
true if transition into state was marked.

isEndState

public boolean isEndState(int state)
Check is a state is the end state

Parameters:
state - the state to check
Returns:
true if state is an end state

initialState

public int initialState()
Get the start state

Returns:
the initial state