Coverage Report - org.galagosearch.tupleflow.execution.Chain
 
Classes in this File Line Coverage Branch Coverage Complexity
Chain
0%
0/11
0%
0/4
0
 
 1  
 // BSD License (http://www.galagosearch.org/license)
 2  
 package org.galagosearch.tupleflow.execution;
 3  
 
 4  
 import java.util.ArrayList;
 5  
 import org.galagosearch.tupleflow.IncompatibleProcessorException;
 6  
 import org.galagosearch.tupleflow.Linkage;
 7  
 import org.galagosearch.tupleflow.Processor;
 8  
 import org.galagosearch.tupleflow.Source;
 9  
 import org.galagosearch.tupleflow.Step;
 10  
 
 11  
 /**
 12  
  *
 13  
  * @author trevor
 14  
  */
 15  0
 public class Chain {
 16  0
     ArrayList<Step> items = new ArrayList();
 17  
 
 18  
     public void add(Step stage) throws IncompatibleProcessorException {
 19  0
         if (items.size() > 0) {
 20  
             // is this a ShreddedProcessor?
 21  0
             Object previousSource = items.get(items.size() - 1);
 22  0
             ((Source) previousSource).setProcessor(stage);
 23  
         }
 24  
 
 25  0
         items.add(stage);
 26  0
     }
 27  
 
 28  
     public Step getStage() {
 29  0
         if (items.size() > 0) {
 30  0
             Step first = items.get(0);
 31  0
             return first;
 32  
         }
 33  0
         return null;
 34  
     }
 35  
 }