com.kuka.graph.impl
Class DefaultGraph<N>

java.lang.Object
  extended by com.kuka.graph.impl.AbstractGraph<N,E>
      extended by com.kuka.graph.impl.AbstractBaseGraph<N,E>
          extended by com.kuka.graph.impl.AbstractBaseListenableGraph<N,DefaultEdge<N>>
              extended by com.kuka.graph.impl.DefaultGraph<N>
Type Parameters:
N - the type of the nodes.
All Implemented Interfaces:
Graph<N,DefaultEdge<N>>, ListenableGraph<N,DefaultEdge<N>>, Serializable, Cloneable, Iterable<N>

public class DefaultGraph<N>
extends AbstractBaseListenableGraph<N,DefaultEdge<N>>

Simple realization of a directed graph. It provides a NodeFactory, which can be set, and a DefaultEdgeFactory for creating nodes respectively edges.

See Also:
Serialized Form

Constructor Summary
DefaultGraph()
          Default constructor with no node factory set.
DefaultGraph(NodeFactory<N> nodeFactory)
          Constructor.
 
Method Summary
 DefaultEdge<N> createEdge(N source, N target)
          Creates a new edge from the specified source node to the target node, adds it to this graph and returns the created edge.
 N createNode()
          Creates a new node, adds it to this graph and returns the created node.
 
Methods inherited from class com.kuka.graph.impl.AbstractBaseListenableGraph
addEdge, addListener, addNode, hasListeners, removeEdge, removeListener, removeNode
 
Methods inherited from class com.kuka.graph.impl.AbstractBaseGraph
clone, containsEdge, containsNode, edges, getEdge, incomingEdges, neighbors, nodes, outgoingEdges
 
Methods inherited from class com.kuka.graph.impl.AbstractGraph
addAllEdges, addAllNodes, clear, containsAllEdges, containsAllNodes, containsEdge, edges, edgeSize, isEmpty, iterator, nodes, nodeSize, removeAllEdges, removeAllNodes, removeEdge, retainAllEdges, retainAllNodes, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.kuka.graph.Graph
addAllEdges, addAllNodes, clear, containsAllEdges, containsAllNodes, containsEdge, containsEdge, containsNode, edges, edges, edgeSize, getEdge, incomingEdges, isEmpty, neighbors, nodes, nodes, nodeSize, outgoingEdges, removeAllEdges, removeAllNodes, removeEdge, retainAllEdges, retainAllNodes
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

DefaultGraph

public DefaultGraph()
Default constructor with no node factory set.


DefaultGraph

public DefaultGraph(NodeFactory<N> nodeFactory)
Constructor.

Parameters:
nodeFactory - the NodeFactory to be set.
Method Detail

createNode

public N createNode()
Description copied from interface: Graph
Creates a new node, adds it to this graph and returns the created node.

Returns:
the created node

createEdge

public DefaultEdge<N> createEdge(N source,
                                 N target)
Description copied from interface: Graph
Creates a new edge from the specified source node to the target node, adds it to this graph and returns the created edge. If graph does not contain the specified nodes they are added, too.

Parameters:
source - the source node of the edge that is to be created
target - the target node of the edge that is to be created
Returns:
the created edge


Copyright © 2019. All rights reserved.