|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.primordion.xholon.base.XPath
Simple XPath implementation. This is NOT a complete implementation of XPath 1.0.
Field Summary |
Fields inherited from interface org.primordion.xholon.base.IXPath |
AXIS_ANCESTOR, AXIS_ANCESTORORSELF, AXIS_ATTRIBUTE, AXIS_CHILD, AXIS_DEFAULT, AXIS_DESCENDANT, AXIS_DESCENDANTORSELF, AXIS_FOLLOWING, AXIS_FOLLOWINGSIBLING, AXIS_NAMESPACE, AXIS_PARENT, AXIS_PRECEDING, AXIS_PRECEDINGSIBLING, AXIS_SELF, XPATH_OP_EQ, XPATH_OP_GE, XPATH_OP_GT, XPATH_OP_LE, XPATH_OP_LT, XPATH_OP_NE, XPATH_OP_NOP |
Constructor Summary | |
XPath()
|
Method Summary | |
IXholon |
evaluate(java.lang.String expression,
IXholon item)
Evaluate an XPath expression in the specified context and return the result as a IXholon. |
java.lang.String |
evaluate(java.lang.String expression,
java.lang.Object item)
Evaluate an XPath expression in the specified context and return the result as a String. |
java.lang.Object |
evaluate(java.lang.String expression,
java.lang.Object item,
int returnType)
Evaluate an XPath expression in the specified context and return the result as the specified type. |
java.util.Vector |
searchForClosestNeighbors(int distance,
int include,
java.lang.String excludeBecName,
java.lang.String xhcName,
int maxQuantity,
boolean matchSuperClasses,
IXholon xhNode)
Search for closest neighbors whose XholonClass names are xhcName. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XPath()
Method Detail |
public java.lang.String evaluate(java.lang.String expression, java.lang.Object item)
IXPath
evaluate
in interface IXPath
expression
- The XPath expression.item
- The starting context (node or node list, for example).
1.3
public java.lang.Object evaluate(java.lang.String expression, java.lang.Object item, int returnType)
IXPath
evaluate
in interface IXPath
expression
- The XPath expression.item
- The starting context (node or node list, for example).returnType
- The desired return type.
1.3
public IXholon evaluate(java.lang.String expression, IXholon item)
IXPath
evaluate
in interface IXPath
expression
- The XPath expression.item
- The starting context, a IXholon.
Examples of expressions (location paths):
ancestor::AnElevatorSystem/Floor[1]/CallButton[1]
ancestor::Cytoplasm/Cytosol/Pyruvate
ancestor::ExtraCellularSolution/child::Glucose
./DescendantName
./child::DescendantName/TargetDescendantName
public java.util.Vector searchForClosestNeighbors(int distance, int include, java.lang.String excludeBecName, java.lang.String xhcName, int maxQuantity, boolean matchSuperClasses, IXholon xhNode)
searchForClosestNeighbors
in interface IXPath
distance
- How far within the tree to search for neighbors.include
- Whether to include (P)arent and/or (S)iblings and/or (C)hildren.excludeBecName
- Name of a XholonClass, used to limit the scope of the returned Vector.xhcName
- Name of a XholonClass.maxQuantity
- Maximum quantity of closest neighbors to return (may return fewer)matchSuperClasses
- Whether or not to match superclasses.xhNode
- A xholon node.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |