Class Graph<V extends Node,E extends Edge>

Type Parameters:
V - the type of vertices
E - the type of edges
All Implemented Interfaces:
Graph<V,E>, Hypergraph<V,E>, MultiGraph<V,E>, Serializable, Iterable<V>
Direct Known Subclasses:
Application, Architecture, Function

public class Graph<V extends Node,E extends Edge> extends SparseMultigraph<V,E> implements Iterable<V>
The Graph is the default graph implementation.
See Also:
  • Constructor Details

    • Graph

      public Graph()
  • Method Details

    • iterator

      public Iterator<V> iterator()
      Specified by:
      iterator in interface Iterable<V extends Node>
    • getVertex

      public V getVertex(V v)
      Return the vertex.
      Parameters:
      v - the vertex
      Returns:
      the vertex
    • getEdge

      public E getEdge(E e)
      Return the edge.
      Parameters:
      e - the edge
      Returns:
      the edge
    • getVertex

      public V getVertex(String id)
      Return the vertex with the specified id or null if no vertex with the given id exists.
      Parameters:
      id - the id
      Returns:
      the vertex
    • getEdge

      public E getEdge(String id)
      Return the edge with the specified id or null if no edge with the given id exists.
      Parameters:
      id - the id
      Returns:
      the edge
    • removeVertices

      public boolean removeVertices(Collection<V> vertices)
      Removes the vertices and returns true if at least one vertex was removed.
      Parameters:
      vertices - the vertices to remove
      Returns:
      true if at least one vertex was removed