예제 #1
0
  /** @see Graph#vertexSet() */
  public Set<V> vertexSet() {
    if (unmodifiableVertexSet == null) {
      unmodifiableVertexSet = Collections.unmodifiableSet(specifics.getVertexSet());
    }

    return unmodifiableVertexSet;
  }
예제 #2
0
  /** @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;
    }
  }
예제 #3
0
 /** @see Graph#containsVertex(Object) */
 public boolean containsVertex(V v) {
   return specifics.getVertexSet().contains(v);
 }