Opus5
Class InOrder

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

public class InOrder
extends AbstractPrePostVisitor

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

Version:
$Id: InOrder.java,v 3.2 1998/07/28 13:46:11 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
InOrder(Visitor visitor)
          Constructs an InOrder visitor using the specified visitor.
 
Method Summary
 void inVisit(java.lang.Object object)
          Invokes the visit method on the visitor to which the the visitor field refers using the specified object.
 boolean isDone()
          Invokes the isDone method on the visitor to which the the visitor field refers.
 
Methods inherited from class Opus5.AbstractPrePostVisitor
postVisit, preVisit
 
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

InOrder

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

inVisit

public void inVisit(java.lang.Object object)
Invokes the visit method on the visitor to which the the visitor field refers using the specified object.
Overrides:
inVisit 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.