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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add an edge and record it so dst is the ith successor of srcvoid
Add this edge, unconditionally setting it as the next successor.void
add a node to this graphboolean
containsNode
(@Nullable T N) int
int
Return the number ofimmediate predecessor
nodes of ngetPredNodes
(@Nullable 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 nodeint
Return the number ofimmediate successor
nodes of this Node in the GraphgetSuccNodes
(@Nullable T N) Return an Iterator over the immediate successor nodes of nboolean
iterator()
void
removeAllIncidentEdges
(T node) void
removeEdge
(T src, T dst) void
removeIncomingEdges
(T node) void
removeNode
(T n) remove a node from this graphvoid
remove a node and all its incident edgesvoid
removeOutgoingEdges
(T node) stream()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
addEdge
in interfaceEdgeManager<T>
- Throws:
IllegalArgumentException
-
addEdge
Description copied from interface:OrderedMultiGraph
add an edge and record it so dst is the ith successor of src- Specified by:
addEdge
in interfaceOrderedMultiGraph<T>
- Throws:
IllegalArgumentException
-
addNode
Description copied from interface:NodeManager
add a node to this graph- Specified by:
addNode
in interfaceNodeManager<T>
-
containsNode
- Specified by:
containsNode
in interfaceNodeManager<T>
- Returns:
- true iff the graph contains the specified node
-
getNumberOfNodes
public int getNumberOfNodes()- Specified by:
getNumberOfNodes
in interfaceNodeManager<T>
- Returns:
- the number of nodes in this graph
-
getPredNodeCount
Description copied from interface:EdgeManager
Return the number ofimmediate predecessor
nodes of n- Specified by:
getPredNodeCount
in 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:
getPredNodes
in interfaceEdgeManager<T>
- Returns:
- an
Iterator
over the immediate predecessor nodes of this Node. - Throws:
IllegalArgumentException
-
getSuccNodeCount
Description copied from interface:EdgeManager
Return the number ofimmediate successor
nodes of this Node in the Graph- Specified by:
getSuccNodeCount
in interfaceEdgeManager<T>
- Returns:
- the number of immediate successor Nodes of this Node in the Graph.
- Throws:
IllegalArgumentException
-
getSuccNodes
Description copied from interface:EdgeManager
Return an Iterator over the immediate successor nodes of nThis method never returns
null
.- Specified by:
getSuccNodes
in interfaceEdgeManager<T>
- Returns:
- an Iterator over the immediate successor nodes of n
- Throws:
IllegalArgumentException
-
hasEdge
- Specified by:
hasEdge
in interfaceEdgeManager<T>
-
iterator
-
stream
-
removeAllIncidentEdges
- Specified by:
removeAllIncidentEdges
in interfaceEdgeManager<T>
- Throws:
UnimplementedError
-
removeEdge
- Specified by:
removeEdge
in interfaceEdgeManager<T>
- Throws:
UnimplementedError
-
removeIncomingEdges
- Specified by:
removeIncomingEdges
in interfaceEdgeManager<T>
- Throws:
UnimplementedError
-
removeNode
Description copied from interface:NodeManager
remove a node from this graph- Specified by:
removeNode
in interfaceNodeManager<T>
- Throws:
UnimplementedError
-
removeNodeAndEdges
Description copied from interface:Graph
remove a node and all its incident edges- Specified by:
removeNodeAndEdges
in interfaceGraph<T>
- Throws:
UnimplementedError
-
removeOutgoingEdges
- Specified by:
removeOutgoingEdges
in interfaceEdgeManager<T>
- Throws:
UnimplementedError
-
getSuccessor
Description copied from interface:OrderedMultiGraph
get the ith successor of a node- Specified by:
getSuccessor
in interfaceOrderedMultiGraph<T>
- Throws:
IllegalArgumentException
-