Package repast.simphony.integration
Class DOMTraverser
java.lang.Object
repast.simphony.integration.DOMTraverser
- All Implemented Interfaces:
Traverser<org.jdom.Element>
A traverser that will traverse a jdom DOM.
- Version:
- $Revision$ $Date$
- Author:
- Jerry Vos
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
getDistance
(org.jdom.Element fromNode, org.jdom.Element toNode) Returns either 1 if the elements are connected, otherwise Double.POSITIVE_INFINITY.Iterator<org.jdom.Element>
getSuccessors
(org.jdom.Element previousNode, org.jdom.Element currentNode) Returns the current node's children.
-
Constructor Details
-
DOMTraverser
public DOMTraverser()
-
-
Method Details
-
getSuccessors
public Iterator<org.jdom.Element> getSuccessors(org.jdom.Element previousNode, org.jdom.Element currentNode) Returns the current node's children.- Specified by:
getSuccessors
in interfaceTraverser<org.jdom.Element>
- Parameters:
previousNode
- ignoredcurrentNode
- the node whose children are retrieved- Returns:
- what would be returned by currentNode.getChildren()
- See Also:
-
Element.getDescendants(org.jdom.filter.Filter)
ElementFilter
-
getDistance
public double getDistance(org.jdom.Element fromNode, org.jdom.Element toNode) Returns either 1 if the elements are connected, otherwise Double.POSITIVE_INFINITY.- Specified by:
getDistance
in interfaceTraverser<org.jdom.Element>
- Parameters:
fromNode
- one nodetoNode
- another node- Returns:
- 1 or POSITIVE_INFINITY
-