Network. It is recommended to extend
this class rather than implement Network directly.
The methods implemented in this class should not be overridden unless the subclass admits a more efficient implementation.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Set | adjacentEdges(E edge)
Implements com. incident node in common with
edge.
|
| public Graph | asGraph()
Implements com. Graph.
|
| private Predicate | |
| public int | degree(N node)
Implements com. node's incident edges, counting
self-loops twice (equivalently, the number of times an edge touches node).
|
| public Optional | edgeConnecting(N nodeU, N nodeV)
Implements com. nodeU to nodeV, if one is
present, or Optional.empty() if no such edge exists.
|
| public Optional | edgeConnecting(EndpointPair<N> endpoints)
Implements com. endpoints (in the order, if any,
specified by endpoints), if one is present, or Optional.empty() if no such edge
exists.
|
| public E | edgeConnectingOrNull(N nodeU, N nodeV)
Implements com. nodeU to nodeV, if one is
present, or null if no such edge exists.
|
| public E | edgeConnectingOrNull(EndpointPair<N> endpoints)
Implements com. endpoints (in the order, if any,
specified by endpoints), if one is present, or null if no such edge exists.
|
| private static <N, E> Map | |
| public Set | edgesConnecting(N nodeU, N nodeV)
Implements com. nodeU to nodeV.
|
| public Set | edgesConnecting(EndpointPair<N> endpoints)
Implements com. endpoints (in the order, if any,
specified by endpoints).
|
| public final boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Implements com. true iff object is a Network that has the same elements and the
same structural relationships as those in this network.
|
| public boolean | hasEdgeConnecting(N nodeU, N nodeV)
Implements com. nodeU to nodeV.
|
| public boolean | hasEdgeConnecting(EndpointPair<N> endpoints)
Implements com. endpoints (in the order, if
any, specified by endpoints).
|
| public final int | hashCode()
Overrides java. Implements com. |
| public int | inDegree(N node)
Implements com. node's incoming edges in a directed
network.
|
| protected final boolean | |
| public int | outDegree(N node)
Implements com. node's outgoing edges in a directed
network.
|
| public String | |
| protected final void | validateEndpoints(EndpointPair<?> endpoints)
Throws an IllegalArgumentException if the ordering of |
| AbstractNetwork | back to summary |
|---|---|
| public AbstractNetwork() | |
| adjacentEdges | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns the edges which have an
| |
| asGraph | back to summary |
|---|---|
| public Graph Implements com. Doc from com. Returns a live view of this network as a If this network
| |
| connectedPredicate | back to summary |
|---|---|
| private Predicate | |
| degree | back to summary |
|---|---|
| public int degree(N node) Implements com. Doc from com. Returns the count of For directed networks, this is equal to For undirected networks, this is equal to If the count is greater than
| |
| edgeConnecting | back to summary |
|---|---|
| public Optional Implements com. Doc from com. Returns the single edge that directly connects In an undirected network, this is equal to
| |
| edgeConnecting | back to summary |
|---|---|
| public Optional Implements com. Doc from com. Returns the single edge that directly connects If this graph is directed, the endpoints must be ordered.
| |
| edgeConnectingOrNull | back to summary |
|---|---|
| public E edgeConnectingOrNull(N nodeU, N nodeV) Implements com. Doc from com. Returns the single edge that directly connects In an undirected network, this is equal to
| |
| edgeConnectingOrNull | back to summary |
|---|---|
| public E edgeConnectingOrNull(EndpointPair<N> endpoints) Implements com. Doc from com. Returns the single edge that directly connects If this graph is directed, the endpoints must be ordered.
| |
| edgeIncidentNodesMap | back to summary |
|---|---|
| private static <N, E> Map | |
| edgesConnecting | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns 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
| |
| edgesConnecting | back to summary |
|---|---|
| public Set Implements com. Doc from com. Returns the set of edges that each directly connect The resulting set of edges will be parallel (i.e. have equal If this network is directed,
| |
| equals | back to summary |
|---|---|
| public final boolean equals(Object obj) Overrides java. Implements com. Doc from com. Returns Thus, two networks A and B are equal if all of the following are true:
Network properties besides A reference implementation of this is provided by
| |
| hasEdgeConnecting | back to summary |
|---|---|
| public boolean hasEdgeConnecting(N nodeU, N nodeV) Implements com. Doc from com. Returns true if there is an edge that directly connects In an undirected graph, this is equal to
| |
| hasEdgeConnecting | back to summary |
|---|---|
| public boolean hasEdgeConnecting(EndpointPair<N> endpoints) Implements com. Doc from com. Returns true if there is an edge that directly connects Unlike the other
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Overrides java. Implements com. Doc from com. Returns the hash code for this network. The hash code of a network is defined as the hash code
of a map from each of its A reference implementation of this is provided by
| |
| inDegree | back to summary |
|---|---|
| public int inDegree(N node) Implements com. Doc from com. Returns the count of If the count is greater than
| |
| isOrderingCompatible | back to summary |
|---|---|
| protected final boolean isOrderingCompatible(EndpointPair<?> endpoints) | |
| outDegree | back to summary |
|---|---|
| public int outDegree(N node) Implements com. Doc from com. Returns the count of If the count is greater than
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this network.
| |
| validateEndpoints | back to summary |
|---|---|
| protected final void validateEndpoints(EndpointPair<?> endpoints) Throws an IllegalArgumentException if the ordering of | |