Class SimpleMutableDirectedGraph<V,A>

java.lang.Object
org.jhotdraw8.graph.AbstractDirectedGraphBuilder
org.jhotdraw8.graph.SimpleMutableDirectedGraph<V,A>
Type Parameters:
V - the vertex data type
A - the arrow data type
All Implemented Interfaces:
AttributedIndexedDirectedGraph<V,A>, BareDirectedGraph<V,A>, BareDirectedVertexGraph<V>, DirectedGraph<V,A>, IndexedDirectedGraph, MutableDirectedGraph<V,A>

public class SimpleMutableDirectedGraph<V,A> extends AbstractDirectedGraphBuilder implements MutableDirectedGraph<V,A>, AttributedIndexedDirectedGraph<V,A>
SimpleMutableDirectedGraph.
Author:
Werner Randelshofer
  • Constructor Details

    • SimpleMutableDirectedGraph

      public SimpleMutableDirectedGraph()
      Creates a new instance with an initial capacity for 16 vertices and 16 arrows.

      Uses a non-identity hash map for storing the vertices.

    • SimpleMutableDirectedGraph

      public SimpleMutableDirectedGraph(int vertexCapacity, int arrowCapacity)
      Creates a new instance with the specified initial capacities.

      Uses a non-identity hash map for storing the vertices.

      Parameters:
      vertexCapacity - the initial capacity for vertices
      arrowCapacity - the initial capacity for arrows
    • SimpleMutableDirectedGraph

      public SimpleMutableDirectedGraph(int vertexCapacity, int arrowCapacity, boolean identityMap)
      Creates a new instance with the specified initial capacities.
      Parameters:
      vertexCapacity - the initial capacity for vertices
      arrowCapacity - the initial capacity for arrows
      identityMap - whether to use an identity hash map for storing the vertices
    • SimpleMutableDirectedGraph

      public SimpleMutableDirectedGraph(@NonNull DirectedGraph<V,A> graph)
      Creates a new instance which contains a copy of the specified graph.
      Parameters:
      graph - a graph
    • SimpleMutableDirectedGraph

      public SimpleMutableDirectedGraph(@NonNull DirectedGraph<VV,AA> graph, @NonNull Function<VV,V> vertexMapper, @NonNull Function3<VV,VV,AA,A> arrowMapper)
      Creates a new instance which contains a copy of the specified graph.

      Uses a non-identity hash map for storing the vertices.

      Type Parameters:
      VV - the vertex data type of the graph
      AA - the arrow data type of the graph
      Parameters:
      graph - a graph
      vertexMapper - a mapping function for the vertices
      arrowMapper - a mapping function for the arrows
  • Method Details