public class PcsPath extends Xholon implements IXPath
TODO IXpath should be renamed IPath, to encompass XPath, PcsPath, and any other path languages.
TODO possibly use + for next sibling, and - for previous sibling
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
DEFAULT_SIZE_MSG_Q, DEFAULT_SIZE_SYSTEM_MSG_Q, GETNAME_DEFAULT, GETNAME_LOCALPART_ID, GETNAME_NOROLENAME, GETNAME_ROLENAME_OR_CLASSNAME, GETNAME_ROLENAMESEP_, GETNAME_SIZE_TEMPLATE, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx, XHOLON_ID_DEFAULT, XHOLON_ID_NULL
Constructor and Description |
---|
PcsPath() |
Modifier and Type | Method and Description |
---|---|
IXholon |
evaluate(java.lang.String expression,
IXholon item)
Evaluate an XPath expression in the specified context and return the result as a IXholon.
|
IXholon |
evaluate(java.lang.String expression,
IXholon item,
java.util.List pathList)
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.lang.String |
getExpression(IXholon sourceNode,
IXholon reffedNode)
Get an XPath 1.0 compliant expression that uniquely identifies a shortest path
from a source node node to a target or referenced node.
|
java.lang.String |
getExpression(IXholon descendant,
IXholon ancestor,
boolean shouldRepeat)
Get an XPath 1.0 compliant expression that uniquely identifies a path
from an ancestor node to a descendant node.
|
java.util.Vector |
searchForClosestNeighbors(int distance,
int include,
java.lang.String excludeXhcName,
java.lang.String xhcName,
int maxQuantity,
boolean matchSuperClasses,
IXholon xhNode)
Search for closest neighbors whose XholonClass names are xhcName.
|
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, compareTo, configure, configure, consoleLog, decVal, decVal, depth, doAction, equals, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getActionList, getAllPorts, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFactory, getFirstChild, getFirstSibling, getId, getInteraction, getInteractionsEnabled, getIQueueImplName, getLastChild, getLastSibling, getLogger, getMsgQ, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPort, getPort, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getSystemMsgQ, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, getXPath, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isActiveObject, isAttributeHandler, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, searchForReferencingNodesRecurse, sendMessage, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_Object, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toString, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize, visit
getClass, hashCode, notify, notifyAll, wait, wait, wait
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, configure, configure, consoleLog, decVal, decVal, depth, doAction, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getActionList, getAllPorts, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPort, getPort, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isActiveObject, isAttributeHandler, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, sendMessage, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_Object, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize, visit
public java.lang.Object evaluate(java.lang.String expression, java.lang.Object item, int returnType)
IXPath
public java.lang.String evaluate(java.lang.String expression, java.lang.Object item)
IXPath
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 IXholon evaluate(java.lang.String expression, IXholon item, java.util.List pathList)
IXPath
evaluate
in interface IXPath
expression
- The XPath expression.item
- The starting context, a IXholon.pathList
- A list that should be filled in with the sequence of nodes found at
each locationStep in the expression. If the input pathList is null, then the method should
not do anything with the list.public java.lang.String getExpression(IXholon descendant, IXholon ancestor, boolean shouldRepeat)
IXPath
getExpression
in interface IXPath
shouldRepeat
- When there is more than one (s)ibling, write multiple 's' (true),
or write an index (false). examples: sss s3descendant
- A Xholon node that is a descendant of ancestor.ancestor
- A Xholon node that is an ancestor of descendant.IXPath.getExpression(org.primordion.xholon.base.IXholon, org.primordion.xholon.base.IXholon, boolean)
public java.lang.String getExpression(IXholon sourceNode, IXholon reffedNode)
IXPath
getExpression
in interface IXPath
sourceNode
- A node in a Xholon tree.reffedNode
- A referenced node in a Xholon tree.public java.util.Vector searchForClosestNeighbors(int distance, int include, java.lang.String excludeXhcName, java.lang.String xhcName, int maxQuantity, boolean matchSuperClasses, IXholon xhNode)
IXPath
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.excludeXhcName
- 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.