Code example for Set

Methods: iterator

0
     * This method will return all edges whose end points are contained in the given set of vertices. 
     * 
     * @param vertices Set of vertices 
     */ 
    public AllEdgesIterator(Set<? extends Vertex> vertices) {
        this.vertexIter = vertices.iterator();
        this.vertices = vertices;
        next = findNext();
    } 
 
    private Edge findNext() { 
        Edge rel = null;
        while (rel == null) {
            if (currentEdges.hasNext()) {
                rel = currentEdges.next();
                if (vertices != null && !vertices.contains(rel.getVertex(Direction.IN)))
                    rel = null;
            } else { 
                if (vertexIter.hasNext()) {
                    Vertex nextVertex = vertexIter.next();