Coverage Report - net.sourceforge.combean.adapters.drasys.graph.DRAGraphNodeIterator
 
Classes in this File Line Coverage Branch Coverage Complexity
DRAGraphNodeIterator
100%
8/8
N/A
1
 
 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 20.03.2005
 20  
  *
 21  
  */
 22  
 package net.sourceforge.combean.adapters.drasys.graph;
 23  
 
 24  
 import java.util.Enumeration;
 25  
 
 26  
 import net.sourceforge.combean.interfaces.graph.Node;
 27  
 import net.sourceforge.combean.interfaces.graph.NodeIterator;
 28  
 import drasys.or.graph.VertexI;
 29  
 
 30  
 /**
 31  
  * @author schickin
 32  
  *
 33  
  */
 34  
 public class DRAGraphNodeIterator implements NodeIterator {
 35  
     
 36  12
     private Enumeration draVertexEnum = null;
 37  12
     private DRAGraphAsGraph draGraph = null;
 38  
 
 39  
     /**
 40  
      * constructor
 41  
      */
 42  
     public DRAGraphNodeIterator(Enumeration draVertexEnum,
 43  
             DRAGraphAsGraph draGraph) {
 44  12
         super();
 45  
         
 46  12
         this.draVertexEnum = draVertexEnum;
 47  12
         this.draGraph = draGraph;
 48  12
     }
 49  
 
 50  
     /* (non-Javadoc)
 51  
      * @see net.sourceforge.combean.interfaces.graph.NodeIterator#hasNext()
 52  
      */
 53  
     public boolean hasNext() {
 54  45
          return this.draVertexEnum.hasMoreElements();
 55  
     }
 56  
 
 57  
     /* (non-Javadoc)
 58  
      * @see net.sourceforge.combean.interfaces.graph.NodeIterator#next()
 59  
      */
 60  
     public Node next() {
 61  27
          return this.draGraph.convertToNode(
 62  
                  (VertexI) this.draVertexEnum.nextElement());
 63  
     }
 64  
 
 65  
 }