Class DOMTraverser

java.lang.Object
repast.simphony.integration.DOMTraverser
All Implemented Interfaces:
Traverser<org.jdom.Element>

public class DOMTraverser extends Object implements Traverser<org.jdom.Element>
A traverser that will traverse a jdom DOM.
Version:
$Revision$ $Date$
Author:
Jerry Vos
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface Traverser<org.jdom.Element>
      Parameters:
      previousNode - ignored
      currentNode - 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 interface Traverser<org.jdom.Element>
      Parameters:
      fromNode - one node
      toNode - another node
      Returns:
      1 or POSITIVE_INFINITY