it.tidalwave.role
Class Composite.VisitorSupport<T,R>

Package class diagram package Composite.VisitorSupport
java.lang.Object
  extended by it.tidalwave.role.Composite.VisitorSupport<T,R>
All Implemented Interfaces:
Composite.Visitor<T,R>
Enclosing interface:
Composite<Type,SpecializedFinder extends Finder<Type>>

public static class Composite.VisitorSupport<T,R>
extends Object
implements Composite.Visitor<T,R>

A support class for Composite.Visitor which provides default empty methods.


Constructor Summary
Composite.VisitorSupport()
           
 
Method Summary
 R getValue()
          Returns the value of this visitor.
 void postVisit(T object)
          Visits an object.
 void preVisit(T object)
          Visits an object.
 void visit(T object)
          Visits an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Composite.VisitorSupport

public Composite.VisitorSupport()
Method Detail

preVisit

public void preVisit(@Nonnull
                     T object)
Visits an object. This method is called before visiting children (pre-order).

Specified by:
preVisit in interface Composite.Visitor<T,R>
Parameters:
object - the visited object

visit

public void visit(@Nonnull
                  T object)
Visits an object. This method is actually called just after #preVisit(), it makes sense to implement it when you don't need to distinguish between pre-order and post-order traversal.

Specified by:
visit in interface Composite.Visitor<T,R>
Parameters:
object - the visited object

postVisit

public void postVisit(@Nonnull
                      T object)
Visits an object. This method is called after visiting children (post-order).

Specified by:
postVisit in interface Composite.Visitor<T,R>
Parameters:
object - the visited object

getValue

@Nonnull
public R getValue()
           throws NotFoundException
Returns the value of this visitor.

Specified by:
getValue in interface Composite.Visitor<T,R>
Returns:
the value
Throws:
NotFoundException - when no value has been found


Copyright © 2009-2012 Tidalwave s.a.s.. All Rights Reserved.