|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbeowulf.model.graph.Edge
The Edge class is used to represent an Edge inside of a Graph object. This
class is meant largely for internal use inside the Graph class, but is
occaisionally the returned value from a method call on an instance of a
Graph. The Edge class stores both the source and destination Node as well
as the 'cost'. The cost can be any Object. The interpretation of the cost
is up to the programmer.
| Field Summary | |
protected Object |
cost
This is the cost of the edge. |
protected Object |
destinationValue
This is the destination node of the edge. |
protected Object |
sourceValue
This is the source node of the edge. |
| Constructor Summary | |
Edge(Object newSourceValue,
Object newDestinationValue,
Object newCost)
Constructs a new edge with the listed source and destination nodes as well as the cost. |
|
| Method Summary | |
boolean |
equals(Object value)
Returns true if value is non-null, an instance of Edge, and
has the same source and destination nodes. |
Object |
getCost()
Returns the cost of the edge. |
Object |
getDestinationValue()
Returns the value of the destination node of the edge. |
Object |
getSourceValue()
Returns the value of the source node of the edge. |
void |
setCost(Object newCost)
Sets the cost of the edge. |
String |
toString()
Returns a String representation of this edge. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Object sourceValue
protected Object destinationValue
protected Object cost
| Constructor Detail |
public Edge(Object newSourceValue,
Object newDestinationValue,
Object newCost)
newSourceValue - The value of the source node for the new edge.newDestinationValue - The value of the destination node for the new
edge.newCost - The cost for the new edge.| Method Detail |
public Object getCost()
public Object getSourceValue()
public Object getDestinationValue()
public void setCost(Object newCost)
newCost - The new cost of the edge.public boolean equals(Object value)
value is non-null, an instance of Edge, and
has the same source and destination nodes.
value - The value to be compared to this object.
public String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||