public class MatchResult extends ListOfNodes
Node.Operations
_nodesList, ID
Constructor and Description |
---|
MatchResult() |
Modifier and Type | Method and Description |
---|---|
void |
completeClosure()
Assigns the value of all occurrences of the meta-reference meta within exp
with the value of meta
|
ContentExpression |
contentExpression(String name)
Return the content expression assigned to the named meta variable.
|
void |
copyValueOf(Node n)
This method replace the graph entirely with the other graph the root is n.
|
boolean |
equals(Object object)
This method return if the node equals another node.
|
Formula |
formula(String name)
Return the formula assigned to the named meta variable
|
Node |
getClone()
This method return a clone of the graph this node of which is the root.
|
ContentExpression |
getContentExpression(String name)
Return the content expression assigned to the named meta variable.
|
Formula |
getFormula(String name)
Return the formula assigned to the named meta variable
|
private Node |
getMetaReference(String name) |
Symbol |
getSymbol(String name)
Return the symbol assigned to the named meta variable.
|
Term |
getTerm(String name)
Return the term assigned to the named meta variable.
|
Variable |
getVariable(String name)
Return the variable assigned to the named meta variable.
|
MatchResult |
intersect(MatchResult other) |
MatchResult |
join(MatchResult other) |
(package private) String |
nameOf(String name) |
protected void |
restore(int size)
Restore a previous size of the MatchResult by removing the last elements until the size
equals the one given as an argument.
|
boolean |
set(String varName,
Node value)
This method returns true if a MetaVariable has the given varName in the
given MatchResult and if it succeeds in giving it the given value.
|
Symbol |
symbol(String name)
Return the symbol assigned to the named meta variable.
|
Term |
term(String name)
Return the term assigned to the named meta variable.
|
String |
toString()
This method return a display of the matching result.
|
Variable |
variable(String name)
Return the variable assigned to the named meta variable.
|
accept, add, add, addAll, addAll, addAll, asACollection, asAList, children, childrenAccept, childrenOfKind, contains, copyValueOf, dofind, dump, find, get, getClassID, getClone, getFirst, getLast, isEmpty, iterator, remove, remove, removeAll, replace, replaceAll, replaceAll, size, sort
addObserver, addOperations, childrenOfKind, childrenOfKind, compare, compareTo, find, find, find, find, getAttribute, getAttribute, getOperations, hasAttribute, hasAttribute, initNode, installOperations, notifyChanges, removeObserver, setAttribute, setAttribute
public Formula getFormula(String name) throws SL.WrongTypeException
name
- the name of the meta variable to get its valuename
, or null
if no formula is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.SL.WrongTypeException
- Thrown if the value of the variable is not a formulapublic Formula formula(String name)
name
- the name of the meta variable to get its valuename
, or null
if no formula is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.public Term getTerm(String name) throws SL.WrongTypeException
name
- the name of the meta variable to get its valuename
, or null
if no term is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.SL.WrongTypeException
- Thrown if the value of the variable is not a term.public Term term(String name)
name
- the name of the meta variable to get its valuename
, or null
if no term is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.public Variable getVariable(String name) throws SL.WrongTypeException
name
- the name of the meta variable to get its valuename
, or null
if no variable is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.SL.WrongTypeException
- Thrown if the value of the variable is not a variable.public Variable variable(String name)
name
- the name of the meta variable to get its valuename
, or null
if no variable is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.public Symbol getSymbol(String name) throws SL.WrongTypeException
name
- the name of the meta variable to get its valuename
, or null
if no symbol is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.SL.WrongTypeException
- Thrown if the value of the variable is not a symbol.public Symbol symbol(String name)
name
- the name of the meta variable to get its valuename
, or null
if no symbol is assigned to this meta variable, meaning the
last matching operation has failed, or no matching operation
has been performed on this pattern.public ContentExpression getContentExpression(String name) throws SL.WrongTypeException
name
- the name of the meta variable to get its valuename
,
or null
if no content expression is
assigned to this meta variable, meaning the last matching
operation has failed, or no matching operation has been
performed on this pattern.SL.WrongTypeException
- Thrown if the value of the variable is not a content
expression.public ContentExpression contentExpression(String name)
name
- the name of the meta variable to get its valuename
,
or null
if no content expression is
assigned to this meta variable, meaning the last matching
operation has failed, or no matching operation has been
performed on this pattern.public String toString()
toString
in class ListOfNodes
public boolean equals(Object object)
Node
public MatchResult intersect(MatchResult other)
other
- the other match result to compute the intersection betweenpublic MatchResult join(MatchResult other)
other
- the other match result to join withpublic Node getClone()
Node
public void copyValueOf(Node n)
Node
copyValueOf
in class Node
n
- the root node of the new graph.public void completeClosure() throws SL.WrongTypeException
SL.WrongTypeException
public boolean set(String varName, Node value)
varName
- the name of a metavariablevalue
- the value of the metavariableprotected void restore(int size)
size
-