Package com.google.common.graph
Class AbstractUndirectedNetworkConnections<N,E>
java.lang.Object
com.google.common.graph.AbstractUndirectedNetworkConnections<N,E>
- Type Parameters:
N- Node parameter typeE- Edge parameter type
- All Implemented Interfaces:
NetworkConnections<N,E>
- Direct Known Subclasses:
UndirectedMultiNetworkConnections,UndirectedNetworkConnections
abstract class AbstractUndirectedNetworkConnections<N,E>
extends Object
implements NetworkConnections<N,E>
A base implementation of
NetworkConnections for undirected networks.-
Field Summary
FieldsModifier and TypeFieldDescriptionKeys are edges incident to the origin node, values are the node at the other end. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAddedgeto the set of incoming edges.voidaddOutEdge(E edge, N node) Addedgeto the set of outgoing edges.adjacentNode(E edge) Returns the node that is adjacent to the origin node alongedge.inEdges()outEdges()removeInEdge(E edge, boolean isSelfLoop) Removeedgefrom the set of incoming edges.removeOutEdge(E edge) Removeedgefrom the set of outgoing edges.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.common.graph.NetworkConnections
adjacentNodes, edgesConnecting
-
Field Details
-
incidentEdgeMap
Keys are edges incident to the origin node, values are the node at the other end.
-
-
Constructor Details
-
AbstractUndirectedNetworkConnections
-
-
Method Details
-
predecessors
- Specified by:
predecessorsin interfaceNetworkConnections<N,E>
-
successors
- Specified by:
successorsin interfaceNetworkConnections<N,E>
-
incidentEdges
- Specified by:
incidentEdgesin interfaceNetworkConnections<N,E>
-
inEdges
- Specified by:
inEdgesin interfaceNetworkConnections<N,E>
-
outEdges
- Specified by:
outEdgesin interfaceNetworkConnections<N,E>
-
adjacentNode
Description copied from interface:NetworkConnectionsReturns the node that is adjacent to the origin node alongedge.In the directed case,
edgeis assumed to be an outgoing edge.- Specified by:
adjacentNodein interfaceNetworkConnections<N,E>
-
removeInEdge
Description copied from interface:NetworkConnectionsRemoveedgefrom the set of incoming edges. Returns the former predecessor node.In the undirected case, returns
nullifisSelfLoopis true.- Specified by:
removeInEdgein interfaceNetworkConnections<N,E>
-
removeOutEdge
Description copied from interface:NetworkConnectionsRemoveedgefrom the set of outgoing edges. Returns the former successor node.- Specified by:
removeOutEdgein interfaceNetworkConnections<N,E>
-
addInEdge
Description copied from interface:NetworkConnectionsAddedgeto the set of incoming edges. Implicitly addsnodeas a predecessor.- Specified by:
addInEdgein interfaceNetworkConnections<N,E>
-
addOutEdge
Description copied from interface:NetworkConnectionsAddedgeto the set of outgoing edges. Implicitly addsnodeas a successor.- Specified by:
addOutEdgein interfaceNetworkConnections<N,E>
-