org.qi4j.functional
Class HierarchicalVisitorAdapter<NODE,LEAF,ThrowableType extends java.lang.Throwable>

java.lang.Object
  extended by org.qi4j.functional.HierarchicalVisitorAdapter<NODE,LEAF,ThrowableType>
All Implemented Interfaces:
HierarchicalVisitor<NODE,LEAF,ThrowableType>, Visitor<LEAF,ThrowableType>

public class HierarchicalVisitorAdapter<NODE,LEAF,ThrowableType extends java.lang.Throwable>
extends java.lang.Object
implements HierarchicalVisitor<NODE,LEAF,ThrowableType>

Generic Hierarchical Visitor interface.


Constructor Summary
HierarchicalVisitorAdapter()
           
 
Method Summary
 boolean visit(LEAF visited)
          Visit an instance of T
 boolean visitEnter(NODE visited)
          Enter an instance of T
 boolean visitLeave(NODE visited)
          Leave an instance of T
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalVisitorAdapter

public HierarchicalVisitorAdapter()
Method Detail

visitEnter

public boolean visitEnter(NODE visited)
                   throws ThrowableType extends java.lang.Throwable
Description copied from interface: HierarchicalVisitor
Enter an instance of T

Specified by:
visitEnter in interface HierarchicalVisitor<NODE,LEAF,ThrowableType extends java.lang.Throwable>
Parameters:
visited - the visited instance which is now entered
Returns:
true if the visitor pattern should continue, false if it should be aborted for this level
Throws:
ThrowableType - if an exception occurred during processing. Any client call that initiated the visiting should get the exception in order to handle it properly.
ThrowableType extends java.lang.Throwable

visitLeave

public boolean visitLeave(NODE visited)
                   throws ThrowableType extends java.lang.Throwable
Description copied from interface: HierarchicalVisitor
Leave an instance of T

Specified by:
visitLeave in interface HierarchicalVisitor<NODE,LEAF,ThrowableType extends java.lang.Throwable>
Parameters:
visited - the visited instance which is now left
Returns:
true if the visitor pattern should continue, false if it should be aborted for the level of this node
Throws:
ThrowableType - if an exception occurred during processing. Any client call that initiated the visiting should get the exception in order to handle it properly.
ThrowableType extends java.lang.Throwable

visit

public boolean visit(LEAF visited)
              throws ThrowableType extends java.lang.Throwable
Description copied from interface: Visitor
Visit an instance of T

Specified by:
visit in interface HierarchicalVisitor<NODE,LEAF,ThrowableType extends java.lang.Throwable>
Specified by:
visit in interface Visitor<LEAF,ThrowableType extends java.lang.Throwable>
Parameters:
visited - the visited instance
Returns:
true if the visitor pattern should continue, false if it should be aborted
Throws:
ThrowableType - if an exception occurred during processing. Any client call that initiated the visiting should get the exception in order to handle it properly.
ThrowableType extends java.lang.Throwable