Class Graphs.TransposedNetwork<N,E>
- All Implemented Interfaces:
Network<N,
,E> PredecessorsFunction<N>
,SuccessorsFunction<N>
- Enclosing class:
Graphs
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondelegate()
edgeConnecting
(EndpointPair<N> endpoints) Returns the single edge that directly connectsendpoints
(in the order, if any, specified byendpoints
), if one is present, orOptional.empty()
if no such edge exists.edgeConnecting
(N nodeU, N nodeV) Returns the single edge that directly connectsnodeU
tonodeV
, if one is present, orOptional.empty()
if no such edge exists.edgeConnectingOrNull
(EndpointPair<N> endpoints) Returns the single edge that directly connectsendpoints
(in the order, if any, specified byendpoints
), if one is present, ornull
if no such edge exists.edgeConnectingOrNull
(N nodeU, N nodeV) Returns the single edge that directly connectsnodeU
tonodeV
, if one is present, ornull
if no such edge exists.edgesConnecting
(EndpointPair<N> endpoints) Returns a live view of the set of edges that each directly connectendpoints
(in the order, if any, specified byendpoints
).edgesConnecting
(N nodeU, N nodeV) Returns a live view of the set of edges that each directly connectnodeU
tonodeV
.boolean
hasEdgeConnecting
(EndpointPair<N> endpoints) Returns true if there is an edge that directly connectsendpoints
(in the order, if any, specified byendpoints
).boolean
hasEdgeConnecting
(N nodeU, N nodeV) Returns true if there is an edge that directly connectsnodeU
tonodeV
.incidentNodes
(E edge) Returns the nodes which are the endpoints ofedge
in this network.int
Returns the count ofnode
'sincoming edges
in a directed network.Returns a live view of all edges in this network which can be traversed in the direction (if any) of the edge to end atnode
.int
Returns the count ofnode
'soutgoing edges
in a directed network.Returns a live view of all edges in this network which can be traversed in the direction (if any) of the edge starting fromnode
.predecessors
(N node) Returns a live view of all nodes in this network adjacent tonode
which can be reached by traversingnode
's incoming edges against the direction (if any) of the edge.successors
(N node) Returns a live view of all nodes in this network adjacent tonode
which can be reached by traversingnode
's outgoing edges in the direction (if any) of the edge.Methods inherited from class com.google.common.graph.ForwardingNetwork
adjacentEdges, adjacentNodes, allowsParallelEdges, allowsSelfLoops, degree, edgeOrder, edges, incidentEdges, isDirected, nodeOrder, nodes
Methods inherited from class com.google.common.graph.AbstractNetwork
asGraph, edgeInvalidatableSet, equals, hashCode, isOrderingCompatible, nodeInvalidatableSet, nodePairInvalidatableSet, toString, validateEndpoints
-
Field Details
-
network
-
-
Constructor Details
-
TransposedNetwork
-
-
Method Details
-
delegate
- Specified by:
delegate
in classForwardingNetwork<N,
E>
-
predecessors
Description copied from interface:Network
Returns a live view of all nodes in this network adjacent tonode
which can be reached by traversingnode
's incoming edges against the direction (if any) of the edge.In an undirected network, this is equivalent to
Network.adjacentNodes(Object)
.If
node
is removed from the network after this method is called, the `Set` returned by this method will be invalidated, and will throw `IllegalStateException` if it is accessed in any way.- Specified by:
predecessors
in interfaceNetwork<N,
E> - Specified by:
predecessors
in interfacePredecessorsFunction<N>
- Overrides:
predecessors
in classForwardingNetwork<N,
E>
-
successors
Description copied from interface:Network
Returns a live view of all nodes in this network adjacent tonode
which can be reached by traversingnode
's outgoing edges in the direction (if any) of the edge.In an undirected network, this is equivalent to
Network.adjacentNodes(Object)
.This is not the same as "all nodes reachable from
node
by following outgoing edges". For that functionality, seeGraphs.reachableNodes(Graph, Object)
.If
node
is removed from the network after this method is called, theSet
view
returned by this method will be invalidated, and will throwIllegalStateException
if it is accessed in any way, with the following exceptions:view.equals(view)
evaluates totrue
(but any other `equals()` expression involvingview
will throw)hashCode()
does not throw- if
node
is re-added to the network after having been removed,view
's behavior is undefined
- Specified by:
successors
in interfaceNetwork<N,
E> - Specified by:
successors
in interfaceSuccessorsFunction<N>
- Overrides:
successors
in classForwardingNetwork<N,
E>
-
inDegree
Description copied from interface:Network
Returns the count ofnode
'sincoming edges
in a directed network. In an undirected network, returns theNetwork.degree(Object)
.If the count is greater than
Integer.MAX_VALUE
, returnsInteger.MAX_VALUE
. -
outDegree
Description copied from interface:Network
Returns the count ofnode
'soutgoing edges
in a directed network. In an undirected network, returns theNetwork.degree(Object)
.If the count is greater than
Integer.MAX_VALUE
, returnsInteger.MAX_VALUE
. -
inEdges
Description copied from interface:Network
Returns a live view of all edges in this network which can be traversed in the direction (if any) of the edge to end atnode
.In a directed network, an incoming edge's
EndpointPair.target()
equalsnode
.In an undirected network, this is equivalent to
Network.incidentEdges(Object)
.If
node
is removed from the network after this method is called, theSet
view
returned by this method will be invalidated, and will throwIllegalStateException
if it is accessed in any way, with the following exceptions:view.equals(view)
evaluates totrue
(but any other `equals()` expression involvingview
will throw)hashCode()
does not throw- if
node
is re-added to the network after having been removed,view
's behavior is undefined
-
outEdges
Description copied from interface:Network
Returns a live view of all edges in this network which can be traversed in the direction (if any) of the edge starting fromnode
.In a directed network, an outgoing edge's
EndpointPair.source()
equalsnode
.In an undirected network, this is equivalent to
Network.incidentEdges(Object)
.If
node
is removed from the network after this method is called, theSet
view
returned by this method will be invalidated, and will throwIllegalStateException
if it is accessed in any way, with the following exceptions:view.equals(view)
evaluates totrue
(but any other `equals()` expression involvingview
will throw)hashCode()
does not throw- if
node
is re-added to the network after having been removed,view
's behavior is undefined
-
incidentNodes
Description copied from interface:Network
Returns the nodes which are the endpoints ofedge
in this network.- Specified by:
incidentNodes
in interfaceNetwork<N,
E> - Overrides:
incidentNodes
in classForwardingNetwork<N,
E>
-
edgesConnecting
Description copied from interface:Network
Returns a live view of the set of edges that each directly connectnodeU
tonodeV
.In an undirected network, this is equal to
edgesConnecting(nodeV, nodeU)
.The resulting set of edges will be parallel (i.e. have equal
Network.incidentNodes(Object)
). If this network does notallow parallel edges
, the resulting set will contain at most one edge (equivalent toedgeConnecting(nodeU, nodeV).asSet()
).If either
nodeU
ornodeV
are removed from the network after this method is called, theSet
view
returned by this method will be invalidated, and will throwIllegalStateException
if it is accessed in any way, with the following exceptions:view.equals(view)
evaluates totrue
(but any other `equals()` expression involvingview
will throw)hashCode()
does not throw- if
nodeU
ornodeV
are re-added to the network after having been removed,view
's behavior is undefined
- Specified by:
edgesConnecting
in interfaceNetwork<N,
E> - Overrides:
edgesConnecting
in classForwardingNetwork<N,
E>
-
edgesConnecting
Description copied from interface:Network
Returns a live view of the set of edges that each directly connectendpoints
(in the order, if any, specified byendpoints
).The resulting set of edges will be parallel (i.e. have equal
Network.incidentNodes(Object)
). If this network does notallow parallel edges
, the resulting set will contain at most one edge (equivalent toedgeConnecting(endpoints).asSet()
).If this network is directed,
endpoints
must be ordered.If either element of
endpoints
is removed from the network after this method is called, theSet
view
returned by this method will be invalidated, and will throwIllegalStateException
if it is accessed in any way, with the following exceptions:view.equals(view)
evaluates totrue
(but any other `equals()` expression involvingview
will throw)hashCode()
does not throw- if either endpoint is re-added to the network after having been removed,
view
's behavior is undefined
- Specified by:
edgesConnecting
in interfaceNetwork<N,
E> - Overrides:
edgesConnecting
in classForwardingNetwork<N,
E>
-
edgeConnecting
Description copied from interface:Network
Returns the single edge that directly connectsnodeU
tonodeV
, if one is present, orOptional.empty()
if no such edge exists.In an undirected network, this is equal to
edgeConnecting(nodeV, nodeU)
.- Specified by:
edgeConnecting
in interfaceNetwork<N,
E> - Overrides:
edgeConnecting
in classForwardingNetwork<N,
E>
-
edgeConnecting
Description copied from interface:Network
Returns the single edge that directly connectsendpoints
(in the order, if any, specified byendpoints
), if one is present, orOptional.empty()
if no such edge exists.If this network is directed, the endpoints must be ordered.
- Specified by:
edgeConnecting
in interfaceNetwork<N,
E> - Overrides:
edgeConnecting
in classForwardingNetwork<N,
E>
-
edgeConnectingOrNull
Description copied from interface:Network
Returns the single edge that directly connectsnodeU
tonodeV
, if one is present, ornull
if no such edge exists.In an undirected network, this is equal to
edgeConnectingOrNull(nodeV, nodeU)
.- Specified by:
edgeConnectingOrNull
in interfaceNetwork<N,
E> - Overrides:
edgeConnectingOrNull
in classForwardingNetwork<N,
E>
-
edgeConnectingOrNull
Description copied from interface:Network
Returns the single edge that directly connectsendpoints
(in the order, if any, specified byendpoints
), if one is present, ornull
if no such edge exists.If this network is directed, the endpoints must be ordered.
- Specified by:
edgeConnectingOrNull
in interfaceNetwork<N,
E> - Overrides:
edgeConnectingOrNull
in classForwardingNetwork<N,
E>
-
hasEdgeConnecting
Description copied from interface:Network
Returns true if there is an edge that directly connectsnodeU
tonodeV
. This is equivalent tonodes().contains(nodeU) && successors(nodeU).contains(nodeV)
, and toedgeConnectingOrNull(nodeU, nodeV) != null
.In an undirected network, this is equal to
hasEdgeConnecting(nodeV, nodeU)
.- Specified by:
hasEdgeConnecting
in interfaceNetwork<N,
E> - Overrides:
hasEdgeConnecting
in classForwardingNetwork<N,
E>
-
hasEdgeConnecting
Description copied from interface:Network
Returns true if there is an edge that directly connectsendpoints
(in the order, if any, specified byendpoints
).Unlike the other
EndpointPair
-accepting methods, this method does not throw if the endpoints are unordered and the network is directed; it simply returnsfalse
. This is for consistency withGraph.hasEdgeConnecting(EndpointPair)
andValueGraph.hasEdgeConnecting(EndpointPair)
.- Specified by:
hasEdgeConnecting
in interfaceNetwork<N,
E> - Overrides:
hasEdgeConnecting
in classForwardingNetwork<N,
E>
-