org.apache.wicket.util.visit
Class Visit<R>

java.lang.Object
  extended by org.apache.wicket.util.visit.Visit<R>
Type Parameters:
R - type of object that should be returned by the visit/traversal
All Implemented Interfaces:
IVisit<R>

public class Visit<R>
extends java.lang.Object
implements IVisit<R>

Implementation of IVisit used by traversal algorithms

Author:
igor.vaynberg

Constructor Summary
Visit()
           
 
Method Summary
 void dontGoDeeper()
          Prevents the visitor from visiting any children of the object currently visited
 R getResult()
          Gets the result of the visit/traversal.
 boolean isContinue()
          Checks if the visit/traversal should continue
 boolean isDontGoDeeper()
          Checks if the visit/traversal has been stopped from visiting children of the currently visited object
 boolean isStopped()
          Checks if the visit/traversal has been stopped
 void stop()
          Stops the visit/traversal
 void stop(R result)
          Stops the visit/traversal and returns result
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Visit

public Visit()
Method Detail

stop

public void stop()
Stops the visit/traversal

Specified by:
stop in interface IVisit<R>

stop

public void stop(R result)
Stops the visit/traversal and returns result

Specified by:
stop in interface IVisit<R>

dontGoDeeper

public void dontGoDeeper()
Prevents the visitor from visiting any children of the object currently visited

Specified by:
dontGoDeeper in interface IVisit<R>

isStopped

public boolean isStopped()
Checks if the visit/traversal has been stopped

Returns:
true if the visit/traversal has been stopped

isContinue

public boolean isContinue()
Checks if the visit/traversal should continue

Returns:
true if the visit/traversal should continue

isDontGoDeeper

public boolean isDontGoDeeper()
Checks if the visit/traversal has been stopped from visiting children of the currently visited object

Returns:
true if the visit/traversal should not visit children of the currently visited object

getResult

public R getResult()
Gets the result of the visit/traversal. This value is set using stop(Object) or remains null if visit/traversal has ended in any other way

Returns:
value that should be returned to the method that initiated the visit/traversal


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.