|
|||||||||
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. This class allows for looking for least-cost paths where paths are 'owned' by objects. an object can only own ONE path at a time.
Field Summary | |
protected Vector |
edges
|
protected Vector |
nodes
|
Constructor Summary | |
Graph()
|
Method Summary | |
void |
addEdge(Edge e)
Add an edge to the graph. |
void |
changeNode(Object fromN,
Object n)
Replace a node with another node--all edges will be updated. |
void |
commitPath(Path path,
Object owner,
int cost)
Commit a path to the graph, with the given cost and owner. |
Vector |
getEdges()
Returns all edges |
Vector |
getEdgesFrom(Object node)
Get all edges leaving a particular node |
Vector |
getNodes()
Returns all the nodes. |
Path |
getPath(Object fromObj,
Object toObj)
Get the cheapest path going from from to to. |
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. |
void |
removeOwner(Object owner)
Remove owner from graph edges. |
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 void removeOwner(Object owner)
public Path getPath(Object fromObj, Object toObj)
public void commitPath(Path path, Object owner, int cost)
public void addEdge(Edge e)
public void removeEdge(Edge e)
public void removeEdges(Collection c)
public void removeNode(Object n)
public void changeNode(Object fromN, Object n)
public Vector getNodes()
public Vector getEdges()
public Vector getEdgesFrom(Object node)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |