Coverage Report - org.kuali.rice.kew.engine.node.NodeGraphSearchCriteria
 
Classes in this File Line Coverage Branch Coverage Complexity
NodeGraphSearchCriteria
0%
0/13
0%
0/4
1.6
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kew.engine.node;
 17  
 
 18  
 import java.util.Collection;
 19  
 
 20  
 /**
 21  
  * The criteria defining parameters to a search through a document's node graph.
 22  
  *
 23  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 24  
  */
 25  
 public class NodeGraphSearchCriteria {
 26  
 
 27  
         // search directions
 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  
 }