/** @see Graph#vertexSet() */ public Set<V> vertexSet() { if (unmodifiableVertexSet == null) { unmodifiableVertexSet = Collections.unmodifiableSet(specifics.getVertexSet()); } return unmodifiableVertexSet; }
/** @see Graph#removeVertex(Object) */ public boolean removeVertex(V v) { if (containsVertex(v)) { Set<E> touchingEdgesList = edgesOf(v); // cannot iterate over list - will cause // ConcurrentModificationException removeAllEdges(new ArrayList<E>(touchingEdgesList)); specifics.getVertexSet().remove(v); // remove the vertex itself return true; } else { return false; } }
/** @see Graph#containsVertex(Object) */ public boolean containsVertex(V v) { return specifics.getVertexSet().contains(v); }