|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activemath.omdocjdom.rephrase.OMMatcher
public class OMMatcher
Simple class to describe a matcher deduced from an OpenMath expresion where a match involves XML-tree equality except for variables which can be replaced by anything.
Such a matcher uses an XPath matcher and is, thus, stateful and not thread-safe.
| Constructor Summary | |
|---|---|
OMMatcher(org.jdom.Element pattern)
|
|
OMMatcher(List patterns)
|
|
| Method Summary | |
|---|---|
String |
getVariableCoord(String varName)
|
Iterator |
getVariableNames()
Returns the names of the variables used in the pattern in appearance order. |
String |
getXpathString()
|
List |
match(OJElement omobj)
Finds all occurrences of the pattern as a descendent of the given element. |
OJElement |
selectVariableMatch(org.jdom.Element matchedTerm,
String varName)
Finds the sub-term matched as the term at the variable whose name is provided. |
List |
selectVariableMatches(org.jdom.Element matchedTerm,
String varName)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OMMatcher(org.jdom.Element pattern)
public OMMatcher(List patterns)
| Method Detail |
|---|
public String getXpathString()
public String getVariableCoord(String varName)
public Iterator getVariableNames()
public List match(OJElement omobj)
omobj - the formulae where to search
public OJElement selectVariableMatch(org.jdom.Element matchedTerm,
String varName)
matchedTerm - the result of match(org.activemath.omdocjdom.OJElement)varName - the name of the variable which has allowed a sub-term to match
public List selectVariableMatches(org.jdom.Element matchedTerm,
String varName)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||