|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.pod.lwgraph.Topology
public final class Topology
The primitive data structure underlying a light-weight graph. Clients can instantiate and use this class directly if they don't mind dealing with integer indices to represent nodes and edges. Doing so is recommended only if large graphs are being constructed with no need for information attached to the nodes and/or edges. Note that very little error checking is performed in this class. If information needs to be attached to nodes or edges, then the LightweightGraph class is recommended instead.
Constructor Summary | |
---|---|
Topology()
Create a new, empty, topology |
Method Summary | |
---|---|
void |
connect(int edge,
int tail,
int head)
Connect the tail and head nodes, using the given edge id. |
int |
find(int firstedge,
int tail,
int head)
Find an edge between the given tail and head nodes, starting from the given edge. |
int |
getHead(int edge)
Get the head node of the given edge. |
int |
getMaxEdgeId()
Get the maximum edge id. |
int |
getMaxNodeId()
Get the highest node id known |
int |
getTail(int edge)
Get the tail node of the given edge. |
void |
removeEdge(int edge)
Remove the given edge. |
void |
reverse()
Reverse the graph |
void |
setHead(int edge,
int head)
Set the head node of the given edge. |
void |
setTail(int edge,
int tail)
Set the tail node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Topology()
Method Detail |
---|
public void connect(int edge, int tail, int head)
public int find(int firstedge, int tail, int head)
public int getMaxEdgeId()
public int getHead(int edge)
public int getMaxNodeId()
public int getTail(int edge)
public void removeEdge(int edge)
public void reverse()
public void setHead(int edge, int head)
public void setTail(int edge, int tail)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |