Network that supports the options supplied by NetworkBuilder.
This class maintains a map of nodes to NetworkConnections. This class also maintains a
map of edges to reference nodes. The reference node is defined to be the edge's source node on
directed graphs, and an arbitrary endpoint of the edge on undirected graphs.
Collection-returning accessors return unmodifiable views: the view returned will reflect changes to the graph (if the graph is mutable) but may not be modified by the user.
The time complexity of all collection-returning accessors is O(1), since views are returned.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final boolean | |
| private final ElementOrder | |
| pack-priv final MapIteratorCache | |
| private final boolean | |
| pack-priv final MapIteratorCache | |
| private final ElementOrder |
| Access | Constructor and Description |
|---|---|
| pack-priv | StandardNetwork(NetworkBuilder<? super N, ? super E> builder)
Constructs a graph with the properties specified in |
| pack-priv | StandardNetwork(NetworkBuilder<? super N, ? super E> builder, Map<N, NetworkConnections<N, E>> nodeConnections, Map<E, N> edgeToReferenceNode)
Constructs a graph with the properties specified in |
| Modifier and Type | Method and Description |
|---|---|
| public Set | adjacentNodes(N node)
Implements com. node in
this graph.
|
| public boolean | allowsParallelEdges()
Implements com. |
| public boolean | allowsSelfLoops()
Implements com. |
| pack-priv final NetworkConnections | |
| pack-priv final N | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| public ElementOrder | edgeOrder()
Implements com. edges().
|
| public Set | edges()
Implements com. edgeOrder().
|
| public Set | edgesConnecting(N nodeU, N nodeV)
Overrides com. Implements com. nodeU to nodeV.
|
| public Set | incidentEdges(N node)
Implements com. incident nodes in this
network include node.
|
| public EndpointPair | incidentNodes(E edge)
Implements com. edge in this network.
|
| public Set | inEdges(N node)
Implements com. node.
|
| public boolean | isDirected()
Implements com. |
| public ElementOrder | nodeOrder()
Implements com. nodes().
|
| public Set | nodes()
Implements com. nodeOrder().
|
| public Set | outEdges(N node)
Implements com. node.
|
| public Set | predecessors(N node)
Implements com. node which can be reached
by traversing node's incoming edges against the direction (if any) of the edge.
|
| public Set | successors(N node)
Implements com. node which can be reached
by traversing node's outgoing edges in the direction (if any) of the edge.
|
| allowsParallelEdges | back to summary |
|---|---|
| private final boolean allowsParallelEdges | |
| allowsSelfLoops | back to summary |
|---|---|
| private final boolean allowsSelfLoops | |
| edgeOrder | back to summary |
|---|---|
| private final ElementOrder<E> edgeOrder | |
| edgeToReferenceNode | back to summary |
|---|---|
| pack-priv final MapIteratorCache<E, N> edgeToReferenceNode | |
| isDirected | back to summary |
|---|---|
| private final boolean isDirected | |
| nodeConnections | back to summary |
|---|---|
| pack-priv final MapIteratorCache<N, NetworkConnections<N, E>> nodeConnections | |
| nodeOrder | back to summary |
|---|---|
| private final ElementOrder<N> nodeOrder | |
| StandardNetwork | back to summary |
|---|---|
| pack-priv StandardNetwork(NetworkBuilder<? super N, ? super E> builder) Constructs a graph with the properties specified in | |
| StandardNetwork | back to summary |
|---|---|
| pack-priv StandardNetwork(NetworkBuilder<? super N, ? super E> builder, Map<N, NetworkConnections<N, E>> nodeConnections, Map<E, N> edgeToReferenceNode) Constructs a graph with the properties specified in | |
| adjacentNodes | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns a live view of the nodes which have an incident edge in common with This is equal to the union of If
| |
| allowsParallelEdges | back to summary |
|---|---|
| public boolean allowsParallelEdges() Implements com. Doc from com. Returns true if this network allows parallel edges. Attempting to add a parallel edge to a
network that does not allow them will throw an
| |
| allowsSelfLoops | back to summary |
|---|---|
| public boolean allowsSelfLoops() Implements com. Doc from com. Returns true if this network allows self-loops (edges that connect a node to itself).
Attempting to add a self-loop to a network that does not allow them will throw an
| |
| checkedConnections | back to summary |
|---|---|
| pack-priv final NetworkConnections | |
| checkedReferenceNode | back to summary |
|---|---|
| pack-priv final N checkedReferenceNode(E edge) | |
| containsEdge | back to summary |
|---|---|
| pack-priv final boolean containsEdge(E edge) | |
| containsNode | back to summary |
|---|---|
| pack-priv final boolean containsNode(N node) | |
| edgeOrder | back to summary |
|---|---|
| public ElementOrder Implements com. Doc from com. Returns the order of iteration for the elements of
| |
| edges | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns all edges in this network, in the order specified by
| |
| edgesConnecting | back to summary |
|---|---|
| public Set Overrides com. Implements com. Doc from com. Returns a live view of the set of edges that each directly connect In an undirected network, this is equal to The resulting set of edges will be parallel (i.e. have equal If either
| |
| incidentEdges | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns a live view of the edges whose This is equal to the union of If
| |
| incidentNodes | back to summary |
|---|---|
| public EndpointPair Implements com. Doc from com. Returns the nodes which are the endpoints of
| |
| inEdges | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns a live view of all edges in this network which can be traversed in the direction (if
any) of the edge to end at In a directed network, an incoming edge's In an undirected network, this is equivalent to If
| |
| isDirected | back to summary |
|---|---|
| public boolean isDirected() Implements com. Doc from com. Returns true if the edges in this network are directed. Directed edges connect a
| |
| nodeOrder | back to summary |
|---|---|
| public ElementOrder Implements com. Doc from com. Returns the order of iteration for the elements of
| |
| nodes | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns all nodes in this network, in the order specified by
| |
| outEdges | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns a live view of all edges in this network which can be traversed in the direction (if
any) of the edge starting from In a directed network, an outgoing edge's In an undirected network, this is equivalent to If
| |
| predecessors | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns a live view of all nodes in this network adjacent to In an undirected network, this is equivalent to If
| |
| successors | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns a live view of all nodes in this network adjacent to In an undirected network, this is equivalent to This is not the same as "all nodes reachable from If
| |