org.dbunit.util.search
Class DepthFirstSearch

java.lang.Object
  extended by org.dbunit.util.search.DepthFirstSearch
All Implemented Interfaces:
ISearchAlgorithm

public class DepthFirstSearch
extends Object
implements ISearchAlgorithm

Search using depth-first algorithm.

An instance of this class must be used only once, as it maintains the internal state of the search.

Since:
2.4.0
Version:
$Revision: 843 $ $Date: 2008-10-26 12:06:28 +0100 (Sun, 26 Oct 2008) $
Author:
gommma (gommma AT users.sourceforge.net), Last changed by: $Author: gommma $

Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
DepthFirstSearch()
          Creates a new depth-first algorithm using the maximum search depth for recursing over the nodes.
DepthFirstSearch(int searchDepth)
          Creates a new depth-first algorithm
 
Method Summary
 org.apache.commons.collections.set.ListOrderedSet search(Object[] nodesFrom, ISearchCallback callback)
          Alternative option to search() that takes an array of nodes as input (instead of a Set)
 org.apache.commons.collections.set.ListOrderedSet search(Set nodesFrom, ISearchCallback callback)
          Search all nodes that originates from a set of nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

DepthFirstSearch

public DepthFirstSearch()
Creates a new depth-first algorithm using the maximum search depth for recursing over the nodes.


DepthFirstSearch

public DepthFirstSearch(int searchDepth)
Creates a new depth-first algorithm

Parameters:
searchDepth - The search depth to be used when traversing the nodes recursively. Must be > 0.
Since:
2.4
Method Detail

search

public org.apache.commons.collections.set.ListOrderedSet search(Object[] nodesFrom,
                                                                ISearchCallback callback)
                                                         throws SearchException
Alternative option to search() that takes an array of nodes as input (instead of a Set)

Throws:
SearchException
See Also:
ISearchAlgorithm

search

public org.apache.commons.collections.set.ListOrderedSet search(Set nodesFrom,
                                                                ISearchCallback callback)
                                                         throws SearchException
Description copied from interface: ISearchAlgorithm
Search all nodes that originates from a set of nodes.

Specified by:
search in interface ISearchAlgorithm
Parameters:
nodesFrom - input nodes
callback - helper callback
Returns:
all nodes, in the right dependent order (like a LinkedHashSet)
Throws:
SearchException
See Also:
ISearchAlgorithm


Copyright © 2002-2012. All Rights Reserved.