public abstract class Intent
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Intent.Type
Enumeration of all implemented correction intent types.
|
Modifier and Type | Field and Description |
---|---|
protected Node |
baseNode
Optional reference to the base node associated with the node repair.
|
protected java.util.List<Context> |
contextChain
Optional chain of nested grammar contexts.
|
protected Vertex |
endingVertex
Pair of the ending stratum number and automaton state.
|
protected Context |
grammarContext
Reference to the nested grammar context.
|
int |
ID
Unique assigned identifier to each intent instance.
|
protected Vertex |
initialVertex
Pair of the initial stratum number and automaton state.
|
protected NodeRepair |
nodeRepair
Optional associated node repair (repairing instruction).
|
protected java.util.List<Node> |
nodeSequence
Sequence of nodes to be processed.
|
static java.lang.String |
SEPARATOR
Separator string used for imploding signature components.
|
Modifier | Constructor and Description |
---|---|
protected |
Intent(Node baseNode,
NodeRepair nodeRepair,
Vertex initialVertex,
Vertex endingVertex,
java.util.List<Node> nodeSequence,
Context grammarContext,
java.util.List<Context> contextChain)
Creates a new instance of the correction intent.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
computeChainSignature()
Generates the signature string for the associated context chain.
|
protected abstract java.lang.String |
computeIdentifierPostfix()
Computes the postfix part of the intent local identifier.
|
protected java.lang.String |
computeIdentifierPrefix()
Computes the prefix part of the intent local identifier.
|
protected java.lang.String |
computeIntentIdentifier()
Computes the intent local identifier string.
|
protected abstract java.lang.String |
computeIntentSignature()
Computes the intent signature string.
|
boolean |
equals(java.lang.Object obj)
Note that this function can only be used when comparing correction
intents from within the same correction multigraph!
|
static java.util.List<Intent> |
generateNestedIntents(Intent parentIntent,
int initialStratum,
java.lang.String initialState,
Grammar treeGrammar,
java.util.EnumSet<Intent.Type> enabledIntents)
Generates the set of all permitted nested correction intents.
|
abstract java.util.Set<Intent.Type> |
getAllowedIntents()
Returns the set of correction intent types allowed for nesting.
|
Node |
getBaseNode()
Returns the optional reference to the base node.
|
java.util.List<Context> |
getContextChain()
Returns the optional associated chain of contexts.
|
Vertex |
getEndingVertex()
Returns the pair of the ending stratum number and automaton state.
|
java.lang.String |
getGlobalSignature()
Returns the complete intent signature string.
|
Context |
getGrammarContext()
Returns the reference to the nested grammar context.
|
Vertex |
getInitialVertex()
Returns the pair of the initial stratum number and automaton state.
|
abstract Intent.Type |
getIntentType()
Returns the type of the given correction intent.
|
int |
getLastStratum()
Returns the number of the last stratum for the nested multigraph.
|
java.lang.String |
getLocalIdentifier()
Returns the locally valid intent identifier.
|
NodeRepair |
getNodeRepair()
Returns the node repair associated with the intent.
|
java.util.List<Node> |
getNodesSequence()
Returns the sequence of nested nodes to be processed.
|
int |
getSequenceLength()
Returns the number of nodes in the sequence to be processed.
|
java.lang.String |
getSourceState()
Returns the source state.
|
java.util.Set<java.lang.String> |
getTargetStates()
Returns the set of target states.
|
java.lang.String |
getUniqueLabel()
Returns the globally unique intent instance label.
|
int |
hashCode()
Note that this function can only be used when comparing correction
intents from within the same correction multigraph!
|
void |
printDebugDump(java.lang.String indentPrefix)
Prints the debugging dump of the correction intent.
|
static void |
resetIdProvider()
Resets the current value of the intent identifier provider.
|
protected Node baseNode
null
reference.protected NodeRepair nodeRepair
protected Vertex initialVertex
protected Vertex endingVertex
protected java.util.List<Node> nodeSequence
protected Context grammarContext
protected java.util.List<Context> contextChain
public static java.lang.String SEPARATOR
public final int ID
protected Intent(Node baseNode, NodeRepair nodeRepair, Vertex initialVertex, Vertex endingVertex, java.util.List<Node> nodeSequence, Context grammarContext, java.util.List<Context> contextChain)
baseNode
- Optional associated base node reference.nodeRepair
- Optional repairing instruction.initialVertex
- Pair of the initial stratum and state.endingVertex
- Pair of the ending stratum and state.nodeSequence
- Sequence of nested nodes to be processed.grammarContext
- Nested grammar context reference.contextChain
- Optional chain of grammar contexts.public abstract Intent.Type getIntentType()
public NodeRepair getNodeRepair()
public Node getBaseNode()
public Vertex getInitialVertex()
public Vertex getEndingVertex()
public java.util.List<Node> getNodesSequence()
public int getSequenceLength()
public Context getGrammarContext()
public java.util.List<Context> getContextChain()
public abstract java.util.Set<Intent.Type> getAllowedIntents()
public java.lang.String getSourceState()
public java.util.Set<java.lang.String> getTargetStates()
public int getLastStratum()
public static java.util.List<Intent> generateNestedIntents(Intent parentIntent, int initialStratum, java.lang.String initialState, Grammar treeGrammar, java.util.EnumSet<Intent.Type> enabledIntents)
parentIntent
- Reference to the parental intent.initialStratum
- Number of the initial stratum.initialState
- Name of the initial automaton state.treeGrammar
- Reference to the tree grammar.enabledIntents
- Configuration set of enabled intent types.public java.lang.String getGlobalSignature()
protected abstract java.lang.String computeIntentSignature()
public java.lang.String computeChainSignature()
SEPARATOR
public java.lang.String getLocalIdentifier()
protected java.lang.String computeIntentIdentifier()
protected java.lang.String computeIdentifierPrefix()
protected abstract java.lang.String computeIdentifierPostfix()
public void printDebugDump(java.lang.String indentPrefix)
indentPrefix
- Indentation string.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getUniqueLabel()
public static final void resetIdProvider()