Coverage Report - net.sourceforge.combean.graph.iterators.EdgeIteratorAsIterator
 
Classes in this File Line Coverage Branch Coverage Complexity
EdgeIteratorAsIterator
83%
5/6
N/A
1,25
 
 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 16.01.2005
 20  
  *
 21  
  */
 22  
 package net.sourceforge.combean.graph.iterators;
 23  
 
 24  
 import java.util.Iterator;
 25  
 
 26  
 import net.sourceforge.combean.interfaces.graph.EdgeIterator;
 27  
 import net.sourceforge.combean.util.except.UnsupportedMethodException;
 28  
 
 29  
 /**
 30  
  * Wrap a EdgeIterator as ordinary java.util.Iterator.
 31  
  * 
 32  
  * @author schickin
 33  
  *
 34  
  */
 35  
 public class EdgeIteratorAsIterator implements Iterator {
 36  
         
 37  
         EdgeIterator edgeIter;
 38  
 
 39  
         /**
 40  
          * Construct wrapper for EdgeIterator
 41  
          * 
 42  
          * @param edgeIter EdgeIterator to be wrapped
 43  
          * 
 44  
          */
 45  
         public EdgeIteratorAsIterator(EdgeIterator edgeIter) {
 46  120
                 super();
 47  120
                 this.edgeIter = edgeIter;
 48  120
         }
 49  
 
 50  
         /**
 51  
          * @see java.util.Iterator#remove()
 52  
          */
 53  
         public void remove() {
 54  0
                 throw new UnsupportedMethodException();
 55  
         }
 56  
 
 57  
         /**
 58  
          * @see java.util.Iterator#hasNext()
 59  
          */
 60  
         public boolean hasNext() {
 61  498
                 return this.edgeIter.hasNext();
 62  
         }
 63  
 
 64  
         /**
 65  
          * @see java.util.Iterator#next()
 66  
          */
 67  
         public Object next() {
 68  258
                 return this.edgeIter.next();
 69  
         }
 70  
 }