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-2008 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  * 
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  */
 17  
 package org.kuali.rice.kew.engine.node;
 18  
 
 19  
 import java.util.Collection;
 20  
 
 21  
 /**
 22  
  * The criteria defining parameters to a search through a document's node graph.
 23  
  *
 24  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 25  
  */
 26  
 public class NodeGraphSearchCriteria {
 27  
 
 28  
         // search directions
 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  0
         private int searchDirection = SEARCH_DIRECTION_FORWARD;
 34  
         private Collection startingNodeInstances;
 35  
         private NodeMatcher matcher;
 36  
         
 37  0
         public NodeGraphSearchCriteria(int searchDirection, Collection startingNodeInstances, NodeMatcher matcher) {
 38  0
                 if (startingNodeInstances == null || startingNodeInstances.isEmpty()) {
 39  0
                         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  0
                 this.searchDirection = searchDirection;
 42  0
                 this.startingNodeInstances = startingNodeInstances;
 43  0
                 this.matcher = matcher;
 44  0
         }
 45  
         
 46  
         public NodeGraphSearchCriteria(int searchDirection, Collection startingNodeInstances, String nodeName) {
 47  0
                 this(searchDirection, startingNodeInstances, new NodeNameMatcher(nodeName));
 48  0
         }
 49  
 
 50  
         public NodeMatcher getMatcher() {
 51  0
                 return matcher;
 52  
         }
 53  
 
 54  
         public Collection getStartingNodeInstances() {
 55  0
                 return startingNodeInstances;
 56  
         }
 57  
         
 58  
         public int getSearchDirection() {
 59  0
                 return searchDirection;
 60  
         }
 61  
         
 62  
 }