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