net.sourceforge.cilib.container.visitor
Class PrePostVisitor<E>

java.lang.Object
  extended by net.sourceforge.cilib.container.visitor.Visitor<E>
      extended by net.sourceforge.cilib.container.visitor.PrePostVisitor<E>
Type Parameters:
E - The element type.
Direct Known Subclasses:
InOrderVisitorDecorator, PostOrderVisitorDecorator, PreOrderVisitorDecorator

public class PrePostVisitor<E>
extends Visitor<E>

Extension of the default Visitor to make pre and post visit operations possible.

An example of use would be on Tree containers, whereby the specific traversal would alter the order in which tree nodes are used.

Author:
Gary Pampara

Constructor Summary
PrePostVisitor()
          Create a new instance of PrePostVisitor.
 
Method Summary
 void postVisit(E o)
          Post-visit the given element.
 void preVisit(E o)
          Pre-visit the given element.
 void visit(E o)
          Visit the provided object.
 
Methods inherited from class net.sourceforge.cilib.container.visitor.Visitor
isDone
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrePostVisitor

public PrePostVisitor()
Create a new instance of PrePostVisitor.

Method Detail

preVisit

public void preVisit(E o)
Pre-visit the given element.

Parameters:
o - The object to pre-visit.

visit

public void visit(E o)
Visit the provided object.

Specified by:
visit in class Visitor<E>
Parameters:
o - The object to visit.

postVisit

public void postVisit(E o)
Post-visit the given element.

Parameters:
o - The element to post visit.


Copyright © 2009 CIRG. All Rights Reserved.