| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| DRAGraphEdgeIterator |
|
| 1.0;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.Edge; | |
| 27 | import net.sourceforge.combean.interfaces.graph.EdgeIterator; | |
| 28 | import drasys.or.graph.EdgeI; | |
| 29 | ||
| 30 | /** | |
| 31 | * @author schickin | |
| 32 | * | |
| 33 | */ | |
| 34 | public class DRAGraphEdgeIterator implements EdgeIterator { | |
| 35 | ||
| 36 | private Enumeration draEdgeEnum; | |
| 37 | 834 | private DRAGraphAsGraph draGraph = null; |
| 38 | ||
| 39 | /** | |
| 40 | * constructor | |
| 41 | */ | |
| 42 | public DRAGraphEdgeIterator(Enumeration draEdgeEnum, | |
| 43 | DRAGraphAsGraph draGraph) { | |
| 44 | 834 | super(); |
| 45 | 834 | this.draEdgeEnum = draEdgeEnum; |
| 46 | 834 | this.draGraph = draGraph; |
| 47 | 834 | } |
| 48 | ||
| 49 | /* (non-Javadoc) | |
| 50 | * @see net.sourceforge.combean.interfaces.graph.EdgeIterator#hasNext() | |
| 51 | */ | |
| 52 | public boolean hasNext() { | |
| 53 | 2352 | return this.draEdgeEnum.hasMoreElements(); |
| 54 | } | |
| 55 | ||
| 56 | /* (non-Javadoc) | |
| 57 | * @see net.sourceforge.combean.interfaces.graph.EdgeIterator#next() | |
| 58 | */ | |
| 59 | public Edge next() { | |
| 60 | 867 | return this.draGraph.convertToEdge( |
| 61 | (EdgeI) this.draEdgeEnum.nextElement()); | |
| 62 | } | |
| 63 | ||
| 64 | } |