|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.graph.decorators.EdgeWeightLabeller
A EdgeWeightLabeller applies a label to the edges of a Graph. All edge weights are integers; weights need not be unique. (The cost of not being unique is that there's no way to look up edges by weight.) Note that this stores information with the graph, and as such is not flexible to addition and substraction of nodes.
Method Summary | |
Graph |
getGraph()
Returns the graph associated with this particular labeller. |
static EdgeWeightLabeller |
getLabeller(Graph g)
Finds or creates an edge labeleller for the graph, using the default user data key. |
static EdgeWeightLabeller |
getLabeller(Graph g,
java.lang.Object key)
Finds or creates an edge labeleller for the graph, using the given userdata key. |
int |
getWeight(Edge e)
Gets the weight of a particualr edge. |
static boolean |
hasWeightLabeller(Graph g)
Checks for an edge labeleller for the graph, using the default user data key. |
static boolean |
hasWeightLabeller(Graph g,
java.lang.Object key)
Checks an edge labeleller for the graph at the given key. |
void |
setWeight(Edge e,
int i)
Sets an edge to this weight. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static EdgeWeightLabeller getLabeller(Graph g)
g
-
public static boolean hasWeightLabeller(Graph g)
g
-
public static boolean hasWeightLabeller(Graph g, java.lang.Object key)
public static EdgeWeightLabeller getLabeller(Graph g, java.lang.Object key)
g
-
public int getWeight(Edge e)
e
- an edge that has been weighted.public Graph getGraph()
public void setWeight(Edge e, int i)
e
- the edgei
- the weight
if
- the edge is not part of the graph
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |