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

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