Class DifferenceVisit<T>

java.lang.Object
de.serra.so_dirty.difference.DifferenceVisit<T>
Type Parameters:
T - the type of object the visitor is expected to return. If none use Void.

public class DifferenceVisit<T> extends Object
Allows visitors to control the traversal.
Author:
Peter Lamby
  • Constructor Details

    • DifferenceVisit

      public DifferenceVisit(T value)
      Constructs.

      Allows to specify a default value that is returned by value() if no more specifc is set by stop(Object).

      Parameters:
      value - The default value.
  • Method Details

    • stop

      public void stop()
      Stops the traversal.
    • stop

      public void stop(T value)
      Stops the traversal with value.
      Parameters:
      value - The return value of the traversal.
    • dontGoDeeper

      public void dontGoDeeper()
      Avoids the traversal of children.
    • value

      public T value()
      The value that should be returned by the traversal.
      Returns:
      the value of the traversal.
    • isStopped

      public boolean isStopped()
      Is the traversal stopped?
      Returns:
      true if the traversal is stopped.
    • isDontGoDeeper

      public boolean isDontGoDeeper()
      Should the children not be traversed.
      Returns:
      true if the children should not be traversed.