Package com.saxonica.ee.schema.fsa
Interface State
- All Known Implementing Classes:
AutomatonState
,CountingState
,DeterminizedState
,NonDeterminizedState
,SuffixState
public interface State
A State is a dynamic state of the finite state machine. It may either be a static (non-counting) AutomatonState,
or a dynamically-created CountingState, which represents the combination of an AutomatonState and a counter value
-
Method Summary
Modifier and TypeMethodDescriptiongetEdges()
Get an iterator over all the transitions (edges) allowed from this stategetTransition
(int token, UserComplexType type) Find the edge representing the transition from this state to another state, that is triggered by a given input tokenEdge[]
Get an array of the wildcard transitions (edges) allowed from this state.boolean
Ask whether this state is a valid final state, that is, no further transitions are needed to complete a successful path through the finite state machineConstruct a human-readable message explaining what elements are permitted as transitions from this state
-
Method Details
-
getTransition
Find the edge representing the transition from this state to another state, that is triggered by a given input token- Parameters:
token
- the input token, specifically the fingerprint of an element nametype
- the complex type whose content model we are validating against- Returns:
- the Edge representing the selected transition of the finite state machine, or null if this token is not accepted when in this State (which implies a validation error).
-
isFinalState
boolean isFinalState()Ask whether this state is a valid final state, that is, no further transitions are needed to complete a successful path through the finite state machine- Returns:
- true if this is a valid final state
-
listAllowedElements
CharSequence listAllowedElements()Construct a human-readable message explaining what elements are permitted as transitions from this state- Returns:
- A message indicating what elements may come next
-
getWildcardEdges
Edge[] getWildcardEdges()Get an array of the wildcard transitions (edges) allowed from this state.- Returns:
- an array containing all the edges that represent element wildcards.
-
getEdges
Get an iterator over all the transitions (edges) allowed from this state- Returns:
- an Iterator over all the edges from this state. The objects
returned by this Iterator are
Edge
objects.
-