|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.fsm.FSMInstance
public class FSMInstance
The objects of this class represent instances of working Finite State Machine during parsing a gate document (annotation set). In order to completely define the state a FSM is in one needs to store information regarding: -the position in the FSM transition graph -the position in the annotation graph -the set of bindings that occured up to the current state. note that a set of bindings is an object of type Map that maps names (java.lang.String) to bags of annotations (gate.AnnotationSet)
Constructor Summary | |
---|---|
FSMInstance(FSM supportGraph,
State FSMPosition,
Node startNode,
Node AGPosition,
HashMap bindings,
Document document)
Creates a new FSMInstance object. |
Method Summary | |
---|---|
static void |
clearInstances()
Release all the FSMInstances that are not currently in use |
Object |
clone()
Returns a clone of this object. |
int |
compareTo(Object obj)
Implementation of the compareTo method required by the Comparable interface. |
boolean |
equals(Object other)
|
Node |
getAGPosition()
Returns the node up to which this FSM instance advanced in the Annotation graph during the matching process. |
HashMap |
getBindings()
Gets the map representing the bindings that took place during the matching process this FSM instance performed. |
int |
getFileIndex()
Returns the index in the Jape definition file of the rule that caused the generation of the FSM state this instance is in. |
State |
getFSMPosition()
Returns the position in the support graph for this FSM instance |
long |
getLength()
Returns the length of the parsed region in the document under scrutiny. |
static FSMInstance |
getNewInstance(FSM supportGraph,
State FSMPosition,
Node startNode,
Node AGPosition,
HashMap bindings,
Document doc)
Static method that provides new FSM instances. |
Node |
getStartAGPosition()
Returns the node in the AnnotationSet from which this FSM instance started the matching process. |
FSM |
getSupportGraph()
Returns the FSM transition graph that backs this FSM instance |
int |
hashCode()
Overrides the hashCode method from Object so this obejcts can be stored in hash maps and hash sets. |
static void |
returnInstance(FSMInstance ins)
Static method used to return a FSMInstance that is not needed anymore |
void |
setAGPosition(Node node)
Sets the current position in the AnnotationSet. |
void |
setFSMPosition(State newFSMPos)
Sets the position in the support transition graph for this FSM instance Convenience method for when the state is not known at construction time. |
String |
toString()
Returns a textual representation of this FSM instance. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FSMInstance(FSM supportGraph, State FSMPosition, Node startNode, Node AGPosition, HashMap bindings, Document document)
supportGraph
- the transition graph of the FSMFSMPosition
- the state this instance will be instartNode
- the node in the AnnotationSet where this FSM instance
started the matchingAGPosition
- the node in the AnnotationSet up to which this FSM Instance
advanced during the matching.bindings
- a HashMap that maps from labels (objects of type String)
to sets of annotations (objects of type AnnotationSet). This map stores
all the bindings that took place during the matching process.
This FSMInstance started the matching on an AnnotationSet from "startNode"
and advanced to "AGPosition"; during this process it traversed the path in
the transition graph "supportGraph" from the initial state to
"FSMPosition" and made the bindings stored in "bindings".Method Detail |
---|
public FSM getSupportGraph()
public State getFSMPosition()
public void setFSMPosition(State newFSMPos)
public int getFileIndex()
public Node getStartAGPosition()
public Node getAGPosition()
public void setAGPosition(Node node)
node
- a position in the AnnotationSetpublic HashMap getBindings()
public long getLength()
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
public Object clone()
clone
in class Object
public int compareTo(Object obj)
compareTo
in interface Comparable
public String toString()
toString
in class Object
public static FSMInstance getNewInstance(FSM supportGraph, State FSMPosition, Node startNode, Node AGPosition, HashMap bindings, Document doc)
public static void returnInstance(FSMInstance ins)
public static void clearInstances()
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |