Clover coverage report - Convert - proto0
Coverage timestamp: Mo Nov 22 2004 13:19:16 CET
file stats: LOC: 62   Methods: 6
NCLOC: 39   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ListPath.java 100% 100% 100% 100%
coverage
 1    /*
 2    * Copyright 2004 Ronald Blaschke.
 3    *
 4    * Licensed under the Apache License, Version 2.0 (the "License");
 5    * you may not use this file except in compliance with the License.
 6    * You may obtain a copy of the License at
 7    *
 8    * http://www.apache.org/licenses/LICENSE-2.0
 9    *
 10    * Unless required by applicable law or agreed to in writing, software
 11    * distributed under the License is distributed on an "AS IS" BASIS,
 12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13    * See the License for the specific language governing permissions and
 14    * limitations under the License.
 15    */
 16    package org.rblasch.convert.graph;
 17   
 18    import java.util.Iterator;
 19    import java.util.LinkedList;
 20    import java.util.List;
 21   
 22    public class ListPath implements Path {
 23    private final List /* of Vertex, Edge */ path;
 24   
 25  602 public ListPath(final List /* of Vertex, Edge */ path) {
 26  602 this.path = path;
 27    }
 28   
 29  2 public Vertex getStart() {
 30  2 return (Vertex) path.get(0);
 31    }
 32   
 33  2 public Vertex getEnd() {
 34  2 return (Vertex) path.get(path.size() - 1);
 35    }
 36   
 37  5 public List /* of Vertex */ getVertices() {
 38  5 final List /* of Vertex */ vertices = new LinkedList();
 39  5 for (final Iterator i = path.iterator(); i.hasNext();) {
 40  11 final Object n = i.next();
 41  11 if (n instanceof Vertex) {
 42  8 vertices.add(n);
 43    }
 44    }
 45  5 return vertices;
 46    }
 47   
 48  1138 public List /* of Edge */ getEdges() {
 49  1138 final List /* of Edge */ edges = new LinkedList();
 50  1138 for (final Iterator i = path.iterator(); i.hasNext();) {
 51  5502 final Object n = i.next();
 52  5502 if (n instanceof Edge) {
 53  2182 edges.add(n);
 54    }
 55    }
 56  1138 return edges;
 57    }
 58   
 59  2 public Iterator /* of Vertex, Edge */ iterator() {
 60  2 return path.iterator();
 61    }
 62    }