|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.graphs.Path
An object representing a Path in a Graph.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Nov 04 1997, JH Created class - GUIRLib-v1.0-1.1.0, Feb 24 2000, JH Updated for JDK1.3RC1 to use the Collections - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH Touched for GUIRLib release - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Fields inherited from interface edu.berkeley.guir.lib.graphs.GraphConst |
DEFAULT_NUMBER_EDGES, DEFAULT_NUMBER_NODES, DEFAULT_PATH_SIZE, DEFAULT_WEIGHT, ERROR, TRUE |
Constructor Summary | |
Path()
Create a new empty Path. |
Method Summary | |
void |
addNode(Node node)
Add a Node to the end of the Path. |
void |
addNode(Node node,
float weight)
Add a Node to the end of the Path. |
void |
addNode(Node node,
Float weight)
Add a Node to the end of the Path. |
Object |
clone()
Shallowly clones this Path. |
boolean |
contains(Node node)
See if the specified Node is contained in this Adjacency List. |
boolean |
contains(String strNodeName)
See if the specified Node is contained in this Adjacency List. |
boolean |
equals(Object obj)
|
Node |
getLastNode()
Get the last Node added to this Path. |
Iterator |
getNodes()
Return the list of Nodes. |
Iterator |
getNodesReversed()
Return the list of Nodes in reverse order. |
Iterator |
getWeights()
Return the list of weights. |
Iterator |
getWeightsReversed()
Return the list of weights. |
boolean |
isCycle()
See if there is a cycle in the Path. |
int |
length()
Get the length of the path. |
void |
removeLastNode()
Remove the last Node added from the Path. |
String |
toString()
|
float |
totalWeight()
Sum the weight in the Path. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Path()
Method Detail |
public Iterator getNodes()
public Iterator getNodesReversed()
public Iterator getWeights()
public Iterator getWeightsReversed()
public float totalWeight()
public boolean isCycle()
public boolean contains(Node node)
node
- is the Node to check if for in this Adjacency List.public boolean contains(String strNodeName)
node
- is the Node to check if for in this Adjacency List.public Node getLastNode()
public int length()
public void addNode(Node node)
Currently no runtime checks are done to ensure that this edge is valid or even connects correctly in the Path.
node
- is the Node to add to the end of the Path.GraphConst
public void addNode(Node node, float weight)
Currently no runtime checks are done to ensure that this edge is valid or even connects correctly in the Path.
node
- is the Node to add to the end of the Path.weight
- is the weight of the edge taken. Note that the weight
is meaningless if it is the first node in a Path, and will
thus be ignored.public void removeLastNode()
public void addNode(Node node, Float weight)
strNodeName
- is the name of the Node to add to the end of the Path.GraphConst
public String toString()
toString
in class Object
public Object clone()
clone
in class Object
public boolean equals(Object obj)
equals
in class Object
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |