JTP API Documentation

jtp.frame.vc
Class GraphWalker

java.lang.Object
  |
  +--jtp.frame.vc.GraphWalker
All Implemented Interfaces:
Iterator
Direct Known Subclasses:
BackwardChainingWalker

public abstract class GraphWalker
extends Object
implements Iterator

GraphWalker.java This class walks through the graph of ValueCollections connected with ValueLinks. It keeps a set of visited nodes, preventing cycles. Created: Mon Mar 15 03:18:49 1999


Field Summary
protected  Set history
          The set of visited nodes.
protected  boolean isNew
          Set to true if we have just arrived to a node, and it hasn't yet been returned by next().
protected  LinkedList links
          This is another representation of the path from the starting point of the search to the current node.
protected  LinkedList path
          The stack of Iterators corresponding to the path from the starting point of the search to the current node.
 
Constructor Summary
GraphWalker()
           
 
Method Summary
protected abstract  Object getCurrent()
           
 LinkedList getLinkChain()
           
protected abstract  boolean goDown(Object o)
           
 boolean hasNext()
           
 Object next()
           
 void remove()
           
 void reset()
          resets this GraphWalker: clears history, path and links; sets isNew to false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

history

protected Set history
The set of visited nodes.


path

protected LinkedList path
The stack of Iterators corresponding to the path from the starting point of the search to the current node. Every element of this list is an Iterator of edges leading from the corresponding node that have not yet been taken.


links

protected LinkedList links
This is another representation of the path from the starting point of the search to the current node. This list contains the links that constitute the path.


isNew

protected boolean isNew
Set to true if we have just arrived to a node, and it hasn't yet been returned by next().

Constructor Detail

GraphWalker

public GraphWalker()
Method Detail

reset

public void reset()
resets this GraphWalker: clears history, path and links; sets isNew to false.


hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
Specified by:
remove in interface Iterator

getLinkChain

public LinkedList getLinkChain()

goDown

protected abstract boolean goDown(Object o)

getCurrent

protected abstract Object getCurrent()

JTP API Documentation