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 private int searchDirection = SEARCH_DIRECTION_FORWARD;
33 private Collection startingNodeInstances;
34 private NodeMatcher matcher;
35
36 public NodeGraphSearchCriteria(int searchDirection, Collection startingNodeInstances, NodeMatcher matcher) {
37 if (startingNodeInstances == null || startingNodeInstances.isEmpty()) {
38 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 this.searchDirection = searchDirection;
41 this.startingNodeInstances = startingNodeInstances;
42 this.matcher = matcher;
43 }
44
45 public NodeGraphSearchCriteria(int searchDirection, Collection startingNodeInstances, String nodeName) {
46 this(searchDirection, startingNodeInstances, new NodeNameMatcher(nodeName));
47 }
48
49 public NodeMatcher getMatcher() {
50 return matcher;
51 }
52
53 public Collection getStartingNodeInstances() {
54 return startingNodeInstances;
55 }
56
57 public int getSearchDirection() {
58 return searchDirection;
59 }
60
61 }