com.kuka.graph.impl
Class DefaultGraph<N>
java.lang.Object
com.kuka.graph.impl.AbstractGraph<N,E>
com.kuka.graph.impl.AbstractBaseGraph<N,E>
com.kuka.graph.impl.AbstractBaseListenableGraph<N,DefaultEdge<N>>
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
|
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.AbstractGraph |
addAllEdges, addAllNodes, clear, containsAllEdges, containsAllNodes, containsEdge, edges, edgeSize, isEmpty, iterator, nodes, nodeSize, removeAllEdges, removeAllNodes, removeEdge, retainAllEdges, retainAllNodes, toString |
| 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 |
DefaultGraph
public DefaultGraph()
- Default constructor with no node factory set.
DefaultGraph
public DefaultGraph(NodeFactory<N> nodeFactory)
- Constructor.
- Parameters:
nodeFactory - the NodeFactory to be set.
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 createdtarget - the target node of the edge that is to be created
- Returns:
- the created edge
Copyright © 2019. All rights reserved.