public final class SparseNumberedEdgeManager<T> extends Object implements NumberedEdgeManager<T>, Serializable
Constructor and Description |
---|
SparseNumberedEdgeManager(NumberedNodeManager<T> nodeManager) |
SparseNumberedEdgeManager(NumberedNodeManager<T> nodeManager,
int normalCase,
byte delegateImpl)
If normalOutCount == n, this edge manager will eagerly allocated n words to
hold out edges for each node.
|
Modifier and Type | Method and Description |
---|---|
void |
addEdge(T src,
T dst) |
int |
getPredNodeCount(T N)
Return the number of
immediate predecessor nodes of n |
IntSet |
getPredNodeNumbers(T node) |
Iterator<T> |
getPredNodes(T N)
Return an
Iterator over the immediate predecessor nodes of n
This method never returns null . |
int |
getSuccNodeCount(int number) |
int |
getSuccNodeCount(T N)
Return the number of
immediate successor nodes of this Node in the Graph |
IntSet |
getSuccNodeNumbers(T node) |
Iterator<T> |
getSuccNodes(int number) |
Iterator<T> |
getSuccNodes(T N)
Return an Iterator over the immediate successor nodes of n
|
boolean |
hasAnySuccessor(int node)
This is implemented as a shortcut for efficiency
|
boolean |
hasEdge(T src,
T dst) |
void |
removeAllIncidentEdges(T node) |
void |
removeEdge(T src,
T dst) |
void |
removeIncomingEdges(T node) |
void |
removeOutgoingEdges(T node) |
String |
toString() |
public SparseNumberedEdgeManager(NumberedNodeManager<T> nodeManager)
nodeManager
- an object to track nodespublic SparseNumberedEdgeManager(NumberedNodeManager<T> nodeManager, int normalCase, byte delegateImpl) throws IllegalArgumentException
nodeManager
- an object to track nodesnormalCase
- what is the "normal" number of out edges for a node?IllegalArgumentException
- if normalCase < 0public Iterator<T> getPredNodes(T N) throws IllegalArgumentException
EdgeManager
Iterator
over the immediate predecessor nodes of n
This method never returns null
.getPredNodes
in interface EdgeManager<T>
Iterator
over the immediate predecessor nodes of this Node.IllegalArgumentException
public int getPredNodeCount(T N) throws IllegalArgumentException
EdgeManager
immediate predecessor
nodes of ngetPredNodeCount
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 IntSet getSuccNodeNumbers(T node) throws IllegalArgumentException
getSuccNodeNumbers
in interface NumberedEdgeManager<T>
IllegalArgumentException
public IntSet getPredNodeNumbers(T node) throws IllegalArgumentException
getPredNodeNumbers
in interface NumberedEdgeManager<T>
IllegalArgumentException
public int getSuccNodeCount(T N) throws IllegalArgumentException
EdgeManager
immediate successor
nodes of this Node in the GraphgetSuccNodeCount
in interface EdgeManager<T>
IllegalArgumentException
public int getSuccNodeCount(int number)
public void addEdge(T src, T dst) throws IllegalArgumentException
addEdge
in interface EdgeManager<T>
IllegalArgumentException
public boolean hasEdge(T src, T dst)
hasEdge
in interface EdgeManager<T>
public void removeAllIncidentEdges(T node) throws IllegalArgumentException
removeAllIncidentEdges
in interface EdgeManager<T>
IllegalArgumentException
public void removeIncomingEdges(T node) throws IllegalArgumentException
removeIncomingEdges
in interface EdgeManager<T>
IllegalArgumentException
public void removeEdge(T src, T dst) throws IllegalArgumentException
removeEdge
in interface EdgeManager<T>
IllegalArgumentException
public void removeOutgoingEdges(T node) throws IllegalArgumentException
removeOutgoingEdges
in interface EdgeManager<T>
IllegalArgumentException
public boolean hasAnySuccessor(int node)