|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--container.HashDecorable
|
+--graph.StoredDirectedEdge
A straightforward implementation of the DirectedEdge interface. Other implementations are possible.
| Field Summary | |
protected graph.Vertex |
dest
|
protected java.lang.Object |
element
|
protected graph.Vertex |
orig
|
| Fields inherited from class container.HashDecorable |
m |
| Constructor Summary | |
StoredDirectedEdge(graph.Vertex orig,
graph.Vertex dest,
java.lang.Object element)
Creates a new edge from orig to dest, labeled with element. |
|
| Method Summary | |
graph.Vertex |
destination()
Vertex where this directed edge ends. |
java.lang.Object |
element()
Element stored on this edge. |
graph.Vertex |
origin()
Vertex where this directed edge starts. |
java.lang.String |
toString()
A printable representation of this edge, such as [directed edge 999 from [vertex @12345 - xyz] to [vertex @54321 - abc]]; here 999 is the element stored on the edge. |
| Methods inherited from class container.HashDecorable |
get, has, put, remove |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface container.Decorable |
get, has, put, remove |
| Field Detail |
protected graph.Vertex orig
protected graph.Vertex dest
protected java.lang.Object element
| Constructor Detail |
public StoredDirectedEdge(graph.Vertex orig,
graph.Vertex dest,
java.lang.Object element)
| Method Detail |
public java.lang.Object element()
element in interface Positionpublic graph.Vertex origin()
DirectedEdge
origin in interface DirectedEdgepublic graph.Vertex destination()
DirectedEdge
destination in interface DirectedEdgepublic java.lang.String toString()
The @12345 part is computed from the edge's hash code, just as in Object.toString(). It serves to distinguish multiple distinct edges that might happen to store the same element (e.g., "xyz"). Also, it won't change if we call replaceElement().
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||