Opus5
Class PreOrder

java.lang.Object
  |
  +--Opus5.AbstractPrePostVisitor
        |
        +--Opus5.PreOrder
All Implemented Interfaces:
PrePostVisitor

public class PreOrder
extends AbstractPrePostVisitor

Adapter to convert a Visitor to a PrePostVisitor. Used in conjunction with various depth-first traversal routines to implement preorder traversal.

Version:
$Id: PreOrder.java,v 3.2 1998/07/28 13:59:19 brpreiss Exp $
Author:
Bruno R. Preiss, P.Eng.
See Also:
Tree.depthFirstTraversal(Opus5.PrePostVisitor), Graph.depthFirstTraversal(Opus5.PrePostVisitor, int)

Field Summary
protected  Visitor visitor
          A visitor.
 
Fields inherited from interface Opus5.PrePostVisitor
copyright
 
Constructor Summary
PreOrder(Visitor visitor)
          Constructs a PreOrder visitor using the specified visitor.
 
Method Summary
 boolean isDone()
          Invokes the isDone method on the visitor to which the the visitor field refers.
 void preVisit(java.lang.Object object)
          Invokes the visit method on the visitor to which the the visitor field refers using the specified object.
 
Methods inherited from class Opus5.AbstractPrePostVisitor
inVisit, postVisit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

visitor

protected Visitor visitor
A visitor.
Constructor Detail

PreOrder

public PreOrder(Visitor visitor)
Constructs a PreOrder visitor using the specified visitor.
Parameters:
visitor - The visitor to adapt.
Method Detail

preVisit

public void preVisit(java.lang.Object object)
Invokes the visit method on the visitor to which the the visitor field refers using the specified object.
Overrides:
preVisit in class AbstractPrePostVisitor
Parameters:
object - The object to visit.

isDone

public boolean isDone()
Invokes the isDone method on the visitor to which the the visitor field refers.
Overrides:
isDone in class AbstractPrePostVisitor
Returns:
True if the visitor is done.