T
- type of node in the graphpublic class BasicOrderedMultiGraph<T> extends Object implements OrderedMultiGraph<T>
Constructor and Description |
---|
BasicOrderedMultiGraph() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(int i,
T src,
T dst)
add an edge and record it so dst is the ith successor of src
|
void |
addEdge(T src,
T dst)
Add this edge, unconditionally setting it as the next successor.
|
void |
addNode(T n)
add a node to this graph
|
boolean |
containsNode(T N) |
int |
getNumberOfNodes() |
int |
getPredNodeCount(T N)
Return the number of
immediate predecessor nodes of n |
Iterator<T> |
getPredNodes(T N)
For now, this returns nodes in no particular order! Fix this when needed.
|
T |
getSuccessor(T node,
int i)
get the ith successor of a node
|
int |
getSuccNodeCount(T N)
Return the number of
immediate successor nodes of this Node in the Graph |
Iterator<T> |
getSuccNodes(T N)
Return an Iterator over the immediate successor nodes of n
|
boolean |
hasEdge(T src,
T dst) |
Iterator<T> |
iterator() |
void |
removeAllIncidentEdges(T node) |
void |
removeEdge(T src,
T dst) |
void |
removeIncomingEdges(T node) |
void |
removeNode(T n)
remove a node from this graph
|
void |
removeNodeAndEdges(T N)
remove a node and all its incident edges
|
void |
removeOutgoingEdges(T node) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public void addEdge(T src, T dst) throws IllegalArgumentException
addEdge
in interface EdgeManager<T>
IllegalArgumentException
public void addEdge(int i, T src, T dst) throws IllegalArgumentException
OrderedMultiGraph
addEdge
in interface OrderedMultiGraph<T>
IllegalArgumentException
public void addNode(T n)
NodeManager
addNode
in interface NodeManager<T>
public boolean containsNode(T N)
containsNode
in interface NodeManager<T>
public int getNumberOfNodes()
getNumberOfNodes
in interface NodeManager<T>
public int getPredNodeCount(T N) throws IllegalArgumentException
EdgeManager
immediate predecessor
nodes of ngetPredNodeCount
in interface EdgeManager<T>
IllegalArgumentException
public Iterator<T> getPredNodes(T N) throws IllegalArgumentException
getPredNodes
in interface EdgeManager<T>
Iterator
over the immediate predecessor nodes of this Node.IllegalArgumentException
public int getSuccNodeCount(T N) throws IllegalArgumentException
EdgeManager
immediate successor
nodes of this Node in the GraphgetSuccNodeCount
in interface EdgeManager<T>
IllegalArgumentException
public Iterator<T> getSuccNodes(T N) throws IllegalArgumentException
EdgeManager
This method never returns null
.
getSuccNodes
in interface EdgeManager<T>
IllegalArgumentException
public boolean hasEdge(T src, T dst)
hasEdge
in interface EdgeManager<T>
public void removeAllIncidentEdges(T node) throws UnimplementedError
removeAllIncidentEdges
in interface EdgeManager<T>
UnimplementedError
public void removeEdge(T src, T dst) throws UnimplementedError
removeEdge
in interface EdgeManager<T>
UnimplementedError
public void removeIncomingEdges(T node) throws UnimplementedError
removeIncomingEdges
in interface EdgeManager<T>
UnimplementedError
public void removeNode(T n) throws UnimplementedError
NodeManager
removeNode
in interface NodeManager<T>
UnimplementedError
public void removeNodeAndEdges(T N) throws UnimplementedError
Graph
removeNodeAndEdges
in interface Graph<T>
UnimplementedError
public void removeOutgoingEdges(T node) throws UnimplementedError
removeOutgoingEdges
in interface EdgeManager<T>
UnimplementedError
public T getSuccessor(T node, int i) throws IllegalArgumentException
OrderedMultiGraph
getSuccessor
in interface OrderedMultiGraph<T>
IllegalArgumentException