net.datastructures - version 5.0

net.datastructures
Class EulerTour<E,R>

java.lang.Object
  extended by net.datastructures.EulerTour<E,R>

public abstract class EulerTour<E,R>
extends Object

Template for algorithms traversing a binary tree using an Euler tour. The subclasses of this class will redefine some of the methods of this class to create a specific traversal.


Nested Class Summary
 class EulerTour.TourResult<R>
           
 
Field Summary
protected  BinaryTree<E> tree
           
 
Constructor Summary
EulerTour()
           
 
Method Summary
protected  R eulerTour(Position<E> v)
          Template method
abstract  R execute(BinaryTree<E> T)
          Execution of the traversal.
protected  void init(BinaryTree<E> T)
          Initialization of the traversal
protected  void visitBelow(Position<E> v, EulerTour.TourResult<R> r)
          Method called for the visit on from below
protected  void visitLeft(Position<E> v, EulerTour.TourResult<R> r)
          Method called for the visit on the left
protected  void visitRight(Position<E> v, EulerTour.TourResult<R> r)
          Method called for the visit on the right
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tree

protected BinaryTree<E> tree
Constructor Detail

EulerTour

public EulerTour()
Method Detail

execute

public abstract R execute(BinaryTree<E> T)
Execution of the traversal. This abstract method must be specified in a concrete subclass.


init

protected void init(BinaryTree<E> T)
Initialization of the traversal


eulerTour

protected R eulerTour(Position<E> v)
Template method


visitLeft

protected void visitLeft(Position<E> v,
                         EulerTour.TourResult<R> r)
Method called for the visit on the left


visitBelow

protected void visitBelow(Position<E> v,
                          EulerTour.TourResult<R> r)
Method called for the visit on from below


visitRight

protected void visitRight(Position<E> v,
                          EulerTour.TourResult<R> r)
Method called for the visit on the right


net.datastructures - version 5.0