Package it.tidalwave.role
Class Composite.VisitorSupport<T,R>
- java.lang.Object
-
- it.tidalwave.role.Composite.VisitorSupport<T,R>
-
- All Implemented Interfaces:
Composite.Visitor<T,R>
- Enclosing interface:
- Composite<TYPE,SPECIALIZED_FINDER extends Finder<? extends TYPE>>
public static class Composite.VisitorSupport<T,R> extends java.lang.Object implements Composite.Visitor<T,R>
A support class forComposite.Visitorwhich provides default empty methods.
-
-
Constructor Summary
Constructors Constructor Description VisitorSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RgetValue()Returns the value of this visitor.voidpostVisit(T object)Visits an object.voidpreVisit(T object)Visits an object.voidvisit(T object)Visits an object.
-
-
-
Method Detail
-
preVisit
public void preVisit(@Nonnull T object)Visits an object. This method is called before visiting children (pre-order).- Specified by:
preVisitin interfaceComposite.Visitor<T,R>- Parameters:
object- the visited object
-
visit
public void visit(@Nonnull T object)Visits an object. This method is actually called just afterComposite.Visitor.preVisit(Object), it makes sense to implement it when you don't need to distinguish between pre-order and post-order traversal.- Specified by:
visitin interfaceComposite.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:
postVisitin interfaceComposite.Visitor<T,R>- Parameters:
object- the visited object
-
getValue
@Nonnull public R getValue() throws NotFoundException
Returns the value of this visitor.- Specified by:
getValuein interfaceComposite.Visitor<T,R>- Returns:
- the value
- Throws:
NotFoundException- when no value has been found
-
-