Package aud.graph

Class AbstractGraph<Node extends AbstractNode,Edge extends AbstractEdge>

java.lang.Object
aud.graph.AbstractGraph<Node,Edge>
Type Parameters:
Node - represents a node
Edge - represents an e dge
All Implemented Interfaces:
Graphvizable, GraphvizDecorable, Iterable<Node>
Direct Known Subclasses:
GraphAM

public abstract class AbstractGraph<Node extends AbstractNode,Edge extends AbstractEdge> extends Object implements Iterable<Node>, Graphvizable, GraphvizDecorable
Interface to a graph.

Methods throw an IllegalArgumentException if a given node or edge is invalid, i.e., it equals null, or it is not part of this graph.

  • Constructor Details

    • AbstractGraph

      public AbstractGraph(Node nodeGenerator, Edge edgeGenerator)
      Constructor.

      The constructor takes two objects that serve as "templates" for creating new Node (AbstractNode.create()) and Edge (AbstractEdge.create()) instances.

      Note: The instances are required due to the way how Java generics work (see type erasure). This is different (indeed much simpler but weaker) than, e.g., C++ templates.

      Parameters:
      nodeGenerator - "template" for creating Node instances
      edgeGenerator - "template" for creating Edge instances
  • Method Details