interface ArrowGraphSorted.Builder<N>
A mutable ArrowGraphSorted
builder used to efficiently create new immutable instances. See the Graph documentation and the ArrowGraphSorted.Builder API documentation
Extends: ArrowGraphBase.Builder<N,Tp>
Type parameters
Name | Description |
---|---|
N | the node type |
Properties
connectionSize
Returns the amount of connections in the graph.
connectionSize
context
Returns the context
associated to this collection instance.
context
context
associated to this collection instance.isEmpty
Returns true if there are no entries in the builder.
isEmpty
nodeSize
Returns the amount of nodes in the graph.
nodeSize
Methods
addGraphElement
Adds the given element
graph element to the builder, where a graph element is either a one-element tuple containing a node, or a two-element tuple containing two nodes indicating a connection.
addGraphElement
element
graph element to the builder, where a graph element is either a one-element tuple containing a node, or a two-element tuple containing two nodes indicating a connection.addGraphElements
Adds the graph elements in the given elements
StreamSource to the graph.
addGraphElements
elements
StreamSource to the graph.addNode
Adds the given node
to the graph.
addNode
node
to the graph.addNodes
Adds the given nodes
to the builder.
addNodes
nodes
to the builder.build
Returns an immutable Graph containing the links in this Builder instance.
build
connect
Adds a connection between node1
and node2
to the graph.
connect
node1
and node2
to the graph.connectAll
Adds the connections in given connections
StreamSource
to the graph.
connectAll
connections
StreamSource
to the graph.connectIfNodesExist
Returns true if the graph has changed
connectIfNodesExist
disconnect
Removes the connection between given node1
and node2
if the connection was present.
disconnect
node1
and node2
if the connection was present.disconnectAll
Removes all connections from the given connections
StreamSource
from the graph.
disconnectAll
connections
StreamSource
from the graph.forEach
Performs given function f
for each entry of the collection, using given state
as initial traversal state.
forEach
f
for each entry of the collection, using given state
as initial traversal state.hasConnection
Returns true if the graph has a connection between given nodes node1
and node2
.
hasConnection
node1
and node2
.hasNode
Returns true if the graph contains the given node
.
hasNode
node
.removeNode
Removes the given node
, and any of its connections, from the graph.
removeNode
node
, and any of its connections, from the graph.removeNodes
Removes the given nodes
, and any of their connections, from the graph.
removeNodes
nodes
, and any of their connections, from the graph.