|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.common.parsing.bytes.ByteTranslationStateMachine
public class ByteTranslationStateMachine
Implements a finite state machine for byte string translation. The state
machine uses a trie structure to track strings that have special meanings.
The add(byte) method inserts a new byte "event" into the state
machine for processing.
| Constructor Summary | |
|---|---|
ByteTranslationStateMachine()
|
|
| Method Summary | |
|---|---|
ByteState |
add(byte b)
Add a byte to the state machine and return the corresponding state. |
byte[] |
getSubstitute()
Returns the last string substition. |
int |
getToken()
Returns the last token value. |
void |
init()
Initializes the state machine. |
boolean |
isSubstitute()
Return true if a substitute string is offered. |
boolean |
isToken()
Returns true if the last accepted string is a token. |
void |
load(byte[] value,
int token,
byte[] substitute,
boolean escape)
Loads a string sequence into the state machine. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteTranslationStateMachine()
| Method Detail |
|---|
public void init()
public void load(byte[] value,
int token,
byte[] substitute,
boolean escape)
value - Byte array containing sequencetoken - If the string is a token value, a constant equal to or
greater than zero to identify the tokensubstitute - An alternative value that is a substitute that should
be accepted instead of the parsed stringescape - True if this represents an escape sequence. The next byte
after the escape sequence is accepted.public ByteState add(byte b)
public boolean isSubstitute()
public byte[] getSubstitute()
public boolean isToken()
public int getToken()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||