|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.caida.otter.DirectedGraph
Represent a directed graph, support simple queries on the graph The name field of the graph node should/will be unique because the nodes are kept track of with a hashtable keying on name. Constructors do a shallow copy for new elements.
Constructor Summary | |
DirectedGraph()
Construct an empty graph |
Method Summary | |
boolean |
addPath(GraphNode root,
java.lang.String source)
Add a path to the graph. |
int |
calcMaxDepth(java.util.Vector sources,
java.lang.String sourceName)
Read in a Vector of GraphNodes that will serve as sourcee for the calcMaxDepth algorithm |
GraphNode[] |
getAllNodes()
Return array of all nodes |
java.lang.String[] |
getAllSources()
Return all the sources that have been stored in the graph |
java.util.Vector |
getChildren(java.lang.String source,
java.lang.String name)
Retrieve all the neighbors of a node |
int |
getGraphSize()
Return the count of nodes in the graph |
int |
getMaxDepth(java.lang.String sourceName)
Return the depth from source to destination if calcMaxDepth() has already been called, -1 otherwise |
GraphNode |
getNode(java.lang.String name)
Get a GraphNode by its name |
boolean |
getOrientation(java.lang.String sourceName)
Query of a given source is oriented foward or backward in the graph |
java.lang.Object |
sourceHashGet(java.lang.String getName)
|
java.lang.Object |
sourceHashPut(java.lang.String putName,
java.lang.Object putThing)
|
int |
sourceHashSize()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DirectedGraph()
Method Detail |
public boolean addPath(GraphNode root, java.lang.String source)
graphNodeList
- Vector of nodes specifying a path
from the first element of the array to the lastpublic java.util.Vector getChildren(java.lang.String source, java.lang.String name)
name
- Name of the GraphNode to return the children of.public int getGraphSize()
public GraphNode[] getAllNodes()
public int getMaxDepth(java.lang.String sourceName)
public boolean getOrientation(java.lang.String sourceName)
public int calcMaxDepth(java.util.Vector sources, java.lang.String sourceName)
sources
- A Vector of all the sources to use when calculating
the max depth.public java.lang.String[] getAllSources()
public GraphNode getNode(java.lang.String name)
name
- The name of the GraphNode to look up.public java.lang.Object sourceHashGet(java.lang.String getName)
public java.lang.Object sourceHashPut(java.lang.String putName, java.lang.Object putThing)
public int sourceHashSize()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |