Coverage Report - net.sourceforge.combean.graph.iterators.CombinedPairEdgeIterator
 
Classes in this File Line Coverage Branch Coverage Complexity
CombinedPairEdgeIterator
92%
11/12
88%
7/8
2,333
 
 1  
 /*
 2  
     This file is part of Combean.
 3  
 
 4  
     Combean is free software; you can redistribute it and/or modify
 5  
     it under the terms of the GNU General Public License as published by
 6  
     the Free Software Foundation; either version 2 of the License, or
 7  
     (at your option) any later version.
 8  
 
 9  
     Combean is distributed in the hope that it will be useful,
 10  
     but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12  
     GNU General Public License for more details.
 13  
 
 14  
     You should have received a copy of the GNU General Public License
 15  
     along with Combean; if not, write to the Free Software
 16  
     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 17  
 */
 18  
 /*
 19  
  * Created on 21.03.2005
 20  
  *
 21  
  */
 22  
 package net.sourceforge.combean.graph.iterators;
 23  
 
 24  
 import net.sourceforge.combean.interfaces.graph.Edge;
 25  
 import net.sourceforge.combean.interfaces.graph.EdgeIterator;
 26  
 
 27  
 /**
 28  
  * @author schickin
 29  
  *
 30  
  */
 31  
 public class CombinedPairEdgeIterator implements EdgeIterator {
 32  
 
 33  219
     private EdgeIterator itFirst = null;
 34  219
     private EdgeIterator itSecond = null;
 35  
 
 36  
     /**
 37  
      * 
 38  
      */
 39  
     public CombinedPairEdgeIterator(EdgeIterator itFirst,
 40  
             EdgeIterator itSecond) {
 41  219
         super();
 42  
         
 43  219
         this.itFirst = itFirst;
 44  219
         this.itSecond = itSecond;
 45  219
     }
 46  
 
 47  
     public boolean hasNext() {
 48  648
          return this.itFirst.hasNext() || this.itSecond.hasNext();
 49  
     }
 50  
 
 51  
     public Edge next() {
 52  408
         if (this.itFirst.hasNext()) {
 53  195
             return this.itFirst.next();
 54  
         }
 55  213
         if (this.itSecond.hasNext()) {
 56  213
             return this.itSecond.next();
 57  
         }
 58  0
         return null;
 59  
     }
 60  
 
 61  
 }