|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--util.graph.Graph
Inspired by Gajos's vision of the future, I, a humble and order-following code-monkey named Luke Weisman, have written this Graph class.
Field Summary | |
protected Vector |
edges
|
protected Vector |
nodes
|
Constructor Summary | |
Graph()
|
Method Summary | |
void |
addEdge(Edge e)
Add an edge to the graph. |
void |
addEdge(Object from,
String outPort,
Object to,
String inPort)
|
util.graph.Node |
findNode(Object contents)
Find a node given its contents. |
Vector |
getEdges()
Returns all edges |
Vector |
getEdgesFrom(Object node)
Get all edges leaving a particular node |
Vector |
getNodes()
Returns all the nodes. |
Vector |
getNonSources()
|
Path |
getPath(Object fromObj,
Object toObj)
Get the cheapest path going from from to to. |
Vector |
getSinkNodes()
Returns all nodes that do not have any edges going out of them (so it may return nodes that have no nodes going into them either) |
Vector |
getSinks()
|
Vector |
getSourceNodes()
Returns all nodes that do not have any edges going into them (so it may return nodes that have no nodes going out of them either) |
Vector |
getSources()
|
Edge |
makeEdge(Object from,
String outPort,
Object to,
String inPort)
Override this if you want fancy-style edges. |
protected Path |
makePath(util.graph.Node start)
Override this if you want fancy-style paths. |
void |
removeEdge(Edge e)
Remove edge from graph. |
void |
removeEdges(Collection c)
Remove all edges in collection from the graph. |
void |
removeNode(Object n)
Remove a node, and all edges associated with that node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Vector edges
protected Vector nodes
Constructor Detail |
public Graph()
Method Detail |
public util.graph.Node findNode(Object contents)
protected Path makePath(util.graph.Node start)
public Edge makeEdge(Object from, String outPort, Object to, String inPort)
public Path getPath(Object fromObj, Object toObj)
public void addEdge(Object from, String outPort, Object to, String inPort)
public void addEdge(Edge e)
public void removeEdge(Edge e)
public void removeEdges(Collection c)
public void removeNode(Object n)
public Vector getNodes()
public Vector getEdges()
public Vector getEdgesFrom(Object node)
public Vector getSourceNodes()
public Vector getSources()
public Vector getSinks()
public Vector getNonSources()
public Vector getSinkNodes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |