Coverage Report - org.kuali.rice.krms.framework.engine.EngineResultsImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
EngineResultsImpl
33%
4/12
0%
0/6
2
 
 1  
 package org.kuali.rice.krms.framework.engine;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.List;
 5  
 import java.util.Map;
 6  
 import java.util.Set;
 7  
 
 8  
 import org.kuali.rice.krms.api.engine.EngineResults;
 9  
 import org.kuali.rice.krms.api.engine.ResultEvent;
 10  
 import org.kuali.rice.krms.api.engine.Term;
 11  
 
 12  
 
 13  29
 public class EngineResultsImpl implements EngineResults {
 14  
         
 15  29
         private List<ResultEvent> results = new ArrayList<ResultEvent>();
 16  
         private Map<Object, Set<Term>> termPropositionMap;
 17  
         
 18  
         @Override
 19  
         public void addResult(ResultEvent result) {
 20  1408
                 results.add(result);
 21  1408
         }
 22  
 
 23  
         @Override
 24  
         public List<ResultEvent> getAllResults() {                
 25  0
                 return new ArrayList<ResultEvent>(results); // shallow copy should be defensive enough
 26  
         }
 27  
 
 28  
         @Override
 29  
         public ResultEvent getResultEvent(int index) {
 30  
                 // TODO Auto-generated method stub
 31  0
                 return null;
 32  
         }
 33  
 
 34  
         @Override
 35  
         public List<ResultEvent> getResultsOfType(String type) {
 36  
                 // TODO Auto-generated method stub
 37  0
                 ArrayList<ResultEvent> newList = new ArrayList<ResultEvent>();
 38  0
                 if (type == null) return newList;
 39  0
                 for (int i=0; i<results.size(); i++){
 40  0
                         if (type.equalsIgnoreCase(results.get(i).getType())){
 41  0
                                 newList.add(results.get(i));
 42  
                         }
 43  
                 }
 44  0
                 return newList;
 45  
         }
 46  
 }