Package org.dbunit.util.search
Class DepthFirstSearch
java.lang.Object
org.dbunit.util.search.DepthFirstSearch
- All Implemented Interfaces:
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.
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$ $Date$
- Author:
- gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptionsearch(Object[] nodesFrom, ISearchCallback callback) Alternative option to search() that takes an array of nodes as input (instead of a Set)search(Set nodesFrom, ISearchCallback callback) Search all nodes that originates from a set of nodes.
-
Field Details
-
logger
protected final org.slf4j.Logger logger
-
-
Constructor Details
-
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 Details
-
search
Alternative option to search() that takes an array of nodes as input (instead of a Set)- Throws:
SearchException- See Also:
-
search
Description copied from interface:ISearchAlgorithmSearch all nodes that originates from a set of nodes.- Specified by:
searchin interfaceISearchAlgorithm- Parameters:
nodesFrom- input nodescallback- helper callback- Returns:
- all nodes, in the right dependent order (like a LinkedHashSet)
- Throws:
SearchException- See Also:
-