|
|||
PREV CLASS NEXT CLASS | |||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ch.ethz.graphbench.toolbox.Edge
Class representing an edge in 2D eucledian space.
A new edge cannot be instanciated directly, use the method
createEdge(Vertex from, Vertex to) from the class Graph instead.
Field Summary | |
static int |
ACTIVE_STATE
Specifies that the edge is currently active |
static java.awt.Color |
DEFAULT_EDGE_COLOR
The default color of an edge. |
static int |
INVALID_STATE
Specifies that the edge is invalid |
static int |
PROCESSED_STATE
Specifies that the edge has been processed |
static int |
QUEUED_STATE
Specifies that the edge is currently queued |
static int |
VALID_STATE
Specifies that the edge is valid |
static int |
VOID_STATE
Specifies that the edge is currently active |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Checks if the edge equals to a given object. Two edges are considered equal if: the graph is not directed and the edges connect the same two vertices the graph is directed and the start and end vertex of the edges are the same |
java.awt.Color |
getColor()
Gets the color of the edge |
int |
getEdgeState()
Gets the state of the edge |
Vertex |
getEndVertex()
Gets the endVertex attribute of the Edge object |
int |
getIndex()
Gets the index attribute of the edge |
double |
getLength()
Gets the length of the edge in eucledian space |
Vertex |
getOppositeVertex(Vertex vertex)
Returns the opposite vertex, for the given vertex. |
Vertex |
getStartVertex()
Gets the startVertex attribute of the Edge object |
java.lang.Object |
getUserData(java.lang.Object key)
Returns the value to which the specified key is mapped. |
int |
getWeight()
Gets the weight of the edge. |
void |
putUserData(java.lang.Object key,
java.lang.Object value)
Maps the specified key to the specified value. |
void |
resetEdgeState()
Resets the edge state. |
void |
setColor(java.awt.Color color)
Sets the color of the edge |
void |
setEdgeState(int state)
Sets the state of the edge. Valid states are: QUEUED_STATE, ACTIVE_STATE and PROCESSED_STATE. An edge can only be in one state at any given time. |
void |
setWeight(int weight)
Sets the edge weight. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.awt.Color DEFAULT_EDGE_COLOR
public static final int VOID_STATE
public static final int ACTIVE_STATE
public static final int QUEUED_STATE
public static final int PROCESSED_STATE
public static final int VALID_STATE
public static final int INVALID_STATE
Method Detail |
public void setColor(java.awt.Color color)
color
- The new color valuepublic void setEdgeState(int state)
state
- The new state of the edgepublic void resetEdgeState()
public int getIndex()
public double getLength()
public int getWeight()
public void setWeight(int weight)
weight
- New weight of the edge, 0 for unweighted edges.public java.lang.Object getUserData(java.lang.Object key)
key
- key identifying value to be returnedpublic java.awt.Color getColor()
public int getEdgeState()
public Vertex getOppositeVertex(Vertex vertex)
vertex
- Vertex to find opposite of.public Vertex getStartVertex()
public Vertex getEndVertex()
public void putUserData(java.lang.Object key, java.lang.Object value)
key
- the keyvalue
- the valuepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- Object to compare to.true
if object is equal, false
otherwise
|
|||
PREV CLASS NEXT CLASS | |||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |