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 connectsnodeUtonodeV, 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, ornullif no such edge exists.edgeConnectingOrNull(N nodeU, N nodeV) Returns the single edge that directly connectsnodeUtonodeV, if one is present, ornullif no such edge exists.edgesConnecting(EndpointPair<N> endpoints) Returns the set of edges that each directly connectendpoints(in the order, if any, specified byendpoints).edgesConnecting(N nodeU, N nodeV) Returns the set of edges that each directly connectnodeUtonodeV.booleanhasEdgeConnecting(EndpointPair<N> endpoints) Returns true if there is an edge that directly connectsendpoints(in the order, if any, specified byendpoints).booleanhasEdgeConnecting(N nodeU, N nodeV) Returns true if there is an edge that directly connectsnodeUtonodeV.incidentNodes(E edge) Returns the nodes which are the endpoints ofedgein this network.intReturns the count ofnode'sincoming edgesin a directed network.Returns all edges in this network which can be traversed in the direction (if any) of the edge to end atnode.intReturns the count ofnode'soutgoing edgesin a directed network.Returns all edges in this network which can be traversed in the direction (if any) of the edge starting fromnode.predecessors(N node) Returns all nodes in this network adjacent tonodewhich can be reached by traversingnode's incoming edges against the direction (if any) of the edge.successors(N node) Returns all nodes in this network adjacent tonodewhich 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, nodesMethods inherited from class com.google.common.graph.AbstractNetwork
asGraph, equals, hashCode, isOrderingCompatible, toString, validateEndpoints
-
Field Details
-
network
-
-
Constructor Details
-
TransposedNetwork
-
-
Method Details
-
delegate
- Specified by:
delegatein classForwardingNetwork<N,E>
-
predecessors
Description copied from interface:NetworkReturns all nodes in this network adjacent tonodewhich 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).- Specified by:
predecessorsin interfaceNetwork<N,E> - Specified by:
predecessorsin interfacePredecessorsFunction<N>- Overrides:
predecessorsin classForwardingNetwork<N,E>
-
successors
Description copied from interface:NetworkReturns all nodes in this network adjacent tonodewhich 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
nodeby following outgoing edges". For that functionality, seeGraphs.reachableNodes(Graph, Object).- Specified by:
successorsin interfaceNetwork<N,E> - Specified by:
successorsin interfaceSuccessorsFunction<N>- Overrides:
successorsin classForwardingNetwork<N,E>
-
inDegree
Description copied from interface:NetworkReturns the count ofnode'sincoming edgesin 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:NetworkReturns the count ofnode'soutgoing edgesin 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:NetworkReturns 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). -
outEdges
Description copied from interface:NetworkReturns 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). -
incidentNodes
Description copied from interface:NetworkReturns the nodes which are the endpoints ofedgein this network.- Specified by:
incidentNodesin interfaceNetwork<N,E> - Overrides:
incidentNodesin classForwardingNetwork<N,E>
-
edgesConnecting
Description copied from interface:NetworkReturns the set of edges that each directly connectnodeUtonodeV.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()).- Specified by:
edgesConnectingin interfaceNetwork<N,E> - Overrides:
edgesConnectingin classForwardingNetwork<N,E>
-
edgesConnecting
Description copied from interface:NetworkReturns 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,
endpointsmust be ordered.- Specified by:
edgesConnectingin interfaceNetwork<N,E> - Overrides:
edgesConnectingin classForwardingNetwork<N,E>
-
edgeConnecting
Description copied from interface:NetworkReturns the single edge that directly connectsnodeUtonodeV, if one is present, orOptional.empty()if no such edge exists.In an undirected network, this is equal to
edgeConnecting(nodeV, nodeU).- Specified by:
edgeConnectingin interfaceNetwork<N,E> - Overrides:
edgeConnectingin classForwardingNetwork<N,E>
-
edgeConnecting
Description copied from interface:NetworkReturns 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 graph is directed, the endpoints must be ordered.
- Specified by:
edgeConnectingin interfaceNetwork<N,E> - Overrides:
edgeConnectingin classForwardingNetwork<N,E>
-
edgeConnectingOrNull
Description copied from interface:NetworkReturns the single edge that directly connectsnodeUtonodeV, if one is present, ornullif no such edge exists.In an undirected network, this is equal to
edgeConnectingOrNull(nodeV, nodeU).- Specified by:
edgeConnectingOrNullin interfaceNetwork<N,E> - Overrides:
edgeConnectingOrNullin classForwardingNetwork<N,E>
-
edgeConnectingOrNull
Description copied from interface:NetworkReturns the single edge that directly connectsendpoints(in the order, if any, specified byendpoints), if one is present, ornullif no such edge exists.If this graph is directed, the endpoints must be ordered.
- Specified by:
edgeConnectingOrNullin interfaceNetwork<N,E> - Overrides:
edgeConnectingOrNullin classForwardingNetwork<N,E>
-
hasEdgeConnecting
Description copied from interface:NetworkReturns true if there is an edge that directly connectsnodeUtonodeV. This is equivalent tonodes().contains(nodeU) && successors(nodeU).contains(nodeV), and toedgeConnectingOrNull(nodeU, nodeV) != null.In an undirected graph, this is equal to
hasEdgeConnecting(nodeV, nodeU).- Specified by:
hasEdgeConnectingin interfaceNetwork<N,E> - Overrides:
hasEdgeConnectingin classForwardingNetwork<N,E>
-
hasEdgeConnecting
Description copied from interface:NetworkReturns 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 graph is directed; it simply returnsfalse. This is for consistency withGraph.hasEdgeConnecting(EndpointPair)andValueGraph.hasEdgeConnecting(EndpointPair).- Specified by:
hasEdgeConnectingin interfaceNetwork<N,E> - Overrides:
hasEdgeConnectingin classForwardingNetwork<N,E>
-