Package org.eclipse.gef.graph
Class Graph.Builder
java.lang.Object
org.eclipse.gef.graph.Graph.Builder
- Enclosing class:
- Graph
The 
Graph.Builder can be used to construct a new Graph little
 by little.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classA context object passed to nested builders when creating a builder chain.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionPuts the given key-value-pair into theattributes mapof theGraphwhich is constructed by thisGraph.Builder.<T> Graph.Builderattr(BiConsumer<Graph, T> setter, T value) Uses the given setter to set the attribute value.build()Constructs a newGraphfrom the values which have been supplied to thisGraph.Builder.Constructs a newEdge.Builder.edges(Collection<Edge> edges) protected NodefindOrCreateNode(Object key) Retrieves the node already created by a builder for the given key, or creates a new one via the respectiveNode.Builder.node()Constructs a new (anonymous)Node.Builder.Constructs a new (identifiable)Node.Builder.nodes(Collection<Node> nodes) 
- 
Constructor Details- 
Builderpublic Builder()
 
- 
- 
Method Details- 
attrUses the given setter to set the attribute value.- Type Parameters:
- T- The type of the attribute.
- Parameters:
- setter- The setter to apply.
- value- The value to apply.
- Returns:
- thisfor convenience.
 
- 
attrPuts the given key-value-pair into theattributes mapof theGraphwhich is constructed by thisGraph.Builder.- Parameters:
- key- The attribute name which is inserted.
- value- The attribute value which is inserted.
- Returns:
- thisfor convenience.
 
- 
buildConstructs a newGraphfrom the values which have been supplied to thisGraph.Builder.- Returns:
- A new Graphfrom the values which have been supplied to thisGraph.Builder.
 
- 
edgeConstructs a newEdge.Builder.- Parameters:
- sourceNodeOrKey- The source- Nodeor a key to identify the source- Node(or its- Node.Builder).
- targetNodeOrKey- The target- Nodeor a key to identify the target- Node(or its- Node.Builder).
- Returns:
- A new Edge.Builder.
 
- 
edges- Parameters:
- edges- The- Edges which are added to the- Graphwhich is constructed by this- Graph.Builder.
- Returns:
- thisfor convenience.
 
- 
edges- Parameters:
- edges- The- Edges which are added to the- Graphwhich is constructed by this- Graph.Builder.
- Returns:
- thisfor convenience.
 
- 
findOrCreateNodeRetrieves the node already created by a builder for the given key, or creates a new one via the respectiveNode.Builder.- Parameters:
- key- The key to identify the- Nodeor- Node.Builder.
- Returns:
- An existing or newly created Node.
 
- 
nodeConstructs a new (anonymous)Node.Builder.- Returns:
- A new Node.Builder.
 
- 
nodeConstructs a new (identifiable)Node.Builder.- Parameters:
- key- The key that can be used to identify the- Node.Builder
- Returns:
- A new Node.Builder.
 
- 
nodes- Parameters:
- nodes- The- Nodes which are added to the- Graphwhich is constructed by this- Graph.Builder.
- Returns:
- thisfor convenience.
 
- 
nodes- Parameters:
- nodes- The- Nodes which are added to the- Graphwhich is constructed by this- Graph.Builder.
- Returns:
- thisfor convenience.
 
 
-