|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.Edge
public class Edge
A class implementing common edge type among graphs. This class supports both directed and undirected edges. Edge may also have visited flags set and cleared.
Graph
Field Summary | |
---|---|
protected boolean |
directed
Whether or not this edge is directed. |
protected java.lang.Object |
label
Label associated with edge. |
protected boolean |
visited
Whether or not this edge has been visited. |
protected java.lang.Object[] |
vLabel
Two element array of vertex labels. |
Constructor Summary | |
---|---|
Edge(java.lang.Object vtx1,
java.lang.Object vtx2,
java.lang.Object label,
boolean directed)
Construct a (possibly directed) edge between two labeled vertices. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Test for equality of edges. |
int |
hashCode()
Returns hashcode associated with edge. |
java.lang.Object |
here()
Returns the first vertex (or source if directed). |
boolean |
isDirected()
Check to see if edge is directed. |
boolean |
isVisited()
Check to see if edge has been visited. |
java.lang.Object |
label()
Get label associated with edge. |
void |
reset()
Clear the visited flag associated with edge. |
void |
setLabel(java.lang.Object label)
Sets the label associated with the edge. |
java.lang.Object |
there()
Returns the second vertex (or source if undirected). |
java.lang.String |
toString()
Construct a string representation of edge. |
boolean |
visit()
Test and set visited flag on vertex. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object[] vLabel
protected java.lang.Object label
protected boolean visited
protected boolean directed
Constructor Detail |
---|
public Edge(java.lang.Object vtx1, java.lang.Object vtx2, java.lang.Object label, boolean directed)
vtx1
- The label of a vertex (source if directed).vtx2
- The label of another vertex (destination if directed).label
- The label associated with the edge.directed
- True iff this edge is directed.Method Detail |
---|
public java.lang.Object here()
public java.lang.Object there()
public void setLabel(java.lang.Object label)
label
- Any object to label edge, or null.public java.lang.Object label()
public boolean visit()
public boolean isVisited()
public boolean isDirected()
public void reset()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The other edge.
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |