final class ConstantArcSizeFSA extends FSA
FSABuilder.FSABuilder| Modifier and Type | Field and Description |
|---|---|
static int |
ADDRESS_OFFSET
Offset of the address field inside an arc.
|
static int |
ARC_SIZE
Size of a single arc structure.
|
static int |
BIT_ARC_FINAL
An arc flag indicating the target node of an arc corresponds to a final
state.
|
static int |
BIT_ARC_LAST
An arc flag indicating the arc is last within its state.
|
private byte[] |
data
FSA data, serialized as a byte array.
|
private int |
epsilon
An epsilon state.
|
static int |
FLAGS_OFFSET
Offset of the flags field inside an arc.
|
static int |
FLAGS_SIZE
Size of the flags field (constant for the builder).
|
static int |
LABEL_OFFSET
Offset of the label field inside an arc.
|
static int |
LABEL_SIZE
Size of the label field (constant for the builder).
|
static int |
TARGET_ADDRESS_SIZE
Size of the target address field (constant for the builder).
|
(package private) static int |
TERMINAL_STATE
A dummy address of the terminal state.
|
| Constructor and Description |
|---|
ConstantArcSizeFSA(byte[] data,
int epsilon) |
| Modifier and Type | Method and Description |
|---|---|
int |
getArc(int node,
byte label) |
byte |
getArcLabel(int arc) |
private int |
getArcTarget(int arc)
Fills the target state address of an arc.
|
int |
getEndNode(int arc) |
int |
getFirstArc(int node) |
java.util.Set<FSAFlags> |
getFlags() |
int |
getNextArc(int arc) |
int |
getRootNode() |
boolean |
isArcFinal(int arc) |
private boolean |
isArcLast(int arc) |
boolean |
isArcTerminal(int arc) |
getArcCount, getRightLanguageCount, getSequences, getSequences, iterator, read, read, readRemaining, visitAllStates, visitInPostOrder, visitInPostOrder, visitInPreOrder, visitInPreOrderpublic static final int TARGET_ADDRESS_SIZE
public static final int FLAGS_SIZE
public static final int LABEL_SIZE
public static final int ARC_SIZE
public static final int FLAGS_OFFSET
public static final int LABEL_OFFSET
public static final int ADDRESS_OFFSET
static final int TERMINAL_STATE
public static final int BIT_ARC_FINAL
public static final int BIT_ARC_LAST
private final int epsilon
private final byte[] data
ConstantArcSizeFSA(byte[] data,
int epsilon)
data - FSA data. There must be no trailing bytes after the last state.public int getRootNode()
getRootNode in class FSApublic int getFirstArc(int node)
getFirstArc in class FSAnode - Identifier of the node.node
or 0 if the node has no outgoing arcs.public int getArc(int node,
byte label)
public int getNextArc(int arc)
getNextArc in class FSAarc - The arc's identifier.arc and
leaving node. Zero is returned if no more arcs are
available for the node.public byte getArcLabel(int arc)
getArcLabel in class FSAarc - The arc's identifier.arc.private int getArcTarget(int arc)
public boolean isArcFinal(int arc)
isArcFinal in class FSAarc - The arc's identifier.true if the destination node at the end of
this arc corresponds to an input sequence created when
building this automaton.public boolean isArcTerminal(int arc)
isArcTerminal in class FSAarc - The arc's identifier.true if this arc does not have a
terminating node (@link FSA.getEndNode(int) will throw an
exception). Implies FSA.isArcFinal(int).private boolean isArcLast(int arc)
public int getEndNode(int arc)
getEndNode in class FSAarc - The arc's identifier.arc.
Terminal arcs (those that point to a terminal state) have no end
node representation and throw a runtime exception.