T - Type of the graph nodes.public final class GraphBuilder<T> extends Object
NodeRenderers and
EdgeRenderers.| Constructor and Description |
|---|
GraphBuilder() |
| Modifier and Type | Method and Description |
|---|---|
GraphBuilder<T> |
addEdge(T from,
T to)
Adds the two given nodes to the graph and creates an edge between them if they are not
null. |
GraphBuilder<T> |
addNode(T node)
Adds a single node to the graph.
|
static <T> GraphBuilder<T> |
create() |
T |
getEffectiveNode(T node)
Returns the node that was added first to this builder or the given node if new.
|
GraphBuilder<T> |
graphFormatter(GraphFormatter formatter) |
GraphBuilder<T> |
graphName(String name) |
boolean |
isEmpty() |
GraphBuilder<T> |
omitSelfReferences() |
String |
toString() |
GraphBuilder<T> |
useEdgeRenderer(EdgeRenderer<? super T> edgeRenderer) |
GraphBuilder<T> |
useNodeIdRenderer(NodeRenderer<? super T> nodeIdRenderer) |
GraphBuilder<T> |
useNodeNameRenderer(NodeRenderer<? super T> nodeNameRenderer) |
public static <T> GraphBuilder<T> create()
public GraphBuilder<T> graphName(String name)
public GraphBuilder<T> useNodeIdRenderer(NodeRenderer<? super T> nodeIdRenderer)
public GraphBuilder<T> useNodeNameRenderer(NodeRenderer<? super T> nodeNameRenderer)
public GraphBuilder<T> useEdgeRenderer(EdgeRenderer<? super T> edgeRenderer)
public GraphBuilder<T> omitSelfReferences()
public GraphBuilder<T> graphFormatter(GraphFormatter formatter)
public boolean isEmpty()
public GraphBuilder<T> addNode(T node)
node - The node to add.public GraphBuilder<T> addEdge(T from, T to)
null.
Nothing will be added to the graph if one or both nodes are null.from - From node.to - To node.public T getEffectiveNode(T node)
node - Node.Copyright © 2017. All rights reserved.