1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.engine.node; |
17 | |
|
18 | |
import java.util.Collection; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
public class NodeGraphSearchCriteria { |
26 | |
|
27 | |
|
28 | |
public static final int SEARCH_DIRECTION_FORWARD = 1; |
29 | |
public static final int SEARCH_DIRECTION_BACKWARD = 2; |
30 | |
public static final int SEARCH_DIRECTION_BOTH = 3; |
31 | |
|
32 | 0 | private int searchDirection = SEARCH_DIRECTION_FORWARD; |
33 | |
private Collection startingNodeInstances; |
34 | |
private NodeMatcher matcher; |
35 | |
|
36 | 0 | public NodeGraphSearchCriteria(int searchDirection, Collection startingNodeInstances, NodeMatcher matcher) { |
37 | 0 | if (startingNodeInstances == null || startingNodeInstances.isEmpty()) { |
38 | 0 | throw new IllegalArgumentException("Starting node instances were empty. At least one starting node instance must be specified in order to perform a search."); |
39 | |
} |
40 | 0 | this.searchDirection = searchDirection; |
41 | 0 | this.startingNodeInstances = startingNodeInstances; |
42 | 0 | this.matcher = matcher; |
43 | 0 | } |
44 | |
|
45 | |
public NodeGraphSearchCriteria(int searchDirection, Collection startingNodeInstances, String nodeName) { |
46 | 0 | this(searchDirection, startingNodeInstances, new NodeNameMatcher(nodeName)); |
47 | 0 | } |
48 | |
|
49 | |
public NodeMatcher getMatcher() { |
50 | 0 | return matcher; |
51 | |
} |
52 | |
|
53 | |
public Collection getStartingNodeInstances() { |
54 | 0 | return startingNodeInstances; |
55 | |
} |
56 | |
|
57 | |
public int getSearchDirection() { |
58 | 0 | return searchDirection; |
59 | |
} |
60 | |
|
61 | |
} |