Package com.ibm.wala.util.graph.impl
Class BasicOrderedMultiGraph<T>
java.lang.Object
com.ibm.wala.util.graph.impl.BasicOrderedMultiGraph<T>
- Type Parameters:
T- type of node in the graph
- All Implemented Interfaces:
EdgeManager<T>,Graph<T>,NodeManager<T>,OrderedMultiGraph<T>,Iterable<T>
Inefficient implementation of OrderedMultiGraph.
UNDER CONSTRUCTION.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd an edge and record it so dst is the ith successor of srcvoidAdd this edge, unconditionally setting it as the next successor.voidadd a node to this graphbooleancontainsNode(T N) intintReturn the number ofimmediate predecessornodes of ngetPredNodes(T N) For now, this returns nodes in no particular order! Fix this when needed.getSuccessor(T node, int i) get the ith successor of a nodeintReturn the number ofimmediate successornodes of this Node in the GraphgetSuccNodes(T N) Return an Iterator over the immediate successor nodes of nbooleaniterator()voidremoveAllIncidentEdges(T node) voidremoveEdge(T src, T dst) voidremoveIncomingEdges(T node) voidremoveNode(T n) remove a node from this graphvoidremove a node and all its incident edgesvoidremoveOutgoingEdges(T node) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
BasicOrderedMultiGraph
public BasicOrderedMultiGraph()
-
-
Method Details
-
addEdge
Add this edge, unconditionally setting it as the next successor.- Specified by:
addEdgein interfaceEdgeManager<T>- Throws:
IllegalArgumentException
-
addEdge
Description copied from interface:OrderedMultiGraphadd an edge and record it so dst is the ith successor of src- Specified by:
addEdgein interfaceOrderedMultiGraph<T>- Throws:
IllegalArgumentException
-
addNode
Description copied from interface:NodeManageradd a node to this graph- Specified by:
addNodein interfaceNodeManager<T>
-
containsNode
- Specified by:
containsNodein interfaceNodeManager<T>- Returns:
- true iff the graph contains the specified node
-
getNumberOfNodes
public int getNumberOfNodes()- Specified by:
getNumberOfNodesin interfaceNodeManager<T>- Returns:
- the number of nodes in this graph
-
getPredNodeCount
Description copied from interface:EdgeManagerReturn the number ofimmediate predecessornodes of n- Specified by:
getPredNodeCountin interfaceEdgeManager<T>- Returns:
- the number of immediate predecessors of n.
- Throws:
IllegalArgumentException
-
getPredNodes
For now, this returns nodes in no particular order! Fix this when needed.- Specified by:
getPredNodesin interfaceEdgeManager<T>- Returns:
- an
Iteratorover the immediate predecessor nodes of this Node. - Throws:
IllegalArgumentException
-
getSuccNodeCount
Description copied from interface:EdgeManagerReturn the number ofimmediate successornodes of this Node in the Graph- Specified by:
getSuccNodeCountin interfaceEdgeManager<T>- Returns:
- the number of immediate successor Nodes of this Node in the Graph.
- Throws:
IllegalArgumentException
-
getSuccNodes
Description copied from interface:EdgeManagerReturn an Iterator over the immediate successor nodes of nThis method never returns
null.- Specified by:
getSuccNodesin interfaceEdgeManager<T>- Returns:
- an Iterator over the immediate successor nodes of n
- Throws:
IllegalArgumentException
-
hasEdge
- Specified by:
hasEdgein interfaceEdgeManager<T>
-
iterator
-
removeAllIncidentEdges
- Specified by:
removeAllIncidentEdgesin interfaceEdgeManager<T>- Throws:
UnimplementedError
-
removeEdge
- Specified by:
removeEdgein interfaceEdgeManager<T>- Throws:
UnimplementedError
-
removeIncomingEdges
- Specified by:
removeIncomingEdgesin interfaceEdgeManager<T>- Throws:
UnimplementedError
-
removeNode
Description copied from interface:NodeManagerremove a node from this graph- Specified by:
removeNodein interfaceNodeManager<T>- Throws:
UnimplementedError
-
removeNodeAndEdges
Description copied from interface:Graphremove a node and all its incident edges- Specified by:
removeNodeAndEdgesin interfaceGraph<T>- Throws:
UnimplementedError
-
removeOutgoingEdges
- Specified by:
removeOutgoingEdgesin interfaceEdgeManager<T>- Throws:
UnimplementedError
-
getSuccessor
Description copied from interface:OrderedMultiGraphget the ith successor of a node- Specified by:
getSuccessorin interfaceOrderedMultiGraph<T>- Throws:
IllegalArgumentException
-