|
||||||||||
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
public class 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.
Field Summary | |
---|---|
static Object |
WEIGHT_DEFAULT_KEY
The UserData key that stores edge weights. |
Method Summary | |
---|---|
void |
clear()
Clears all weights stored by this decorator. |
Graph |
getGraph()
Returns the graph associated with this particular labeller. |
static EdgeWeightLabeller |
getLabeller(Graph g)
Finds or creates an edge labeller for the graph, using the default user data key. |
static EdgeWeightLabeller |
getLabeller(Graph g,
Object key)
Finds or creates an edge labeleller for the graph, using the given userdata key. |
Number |
getNumber(ArchetypeEdge e)
|
int |
getWeight(ArchetypeEdge 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,
Object key)
Checks an edge labeleller for the graph at the given key. |
Number |
removeWeight(ArchetypeEdge e)
Removes the weight stored by this decorator for the indicated edge e ,
and returns the value of this weight (or null if there was no
such weight for this edge). |
void |
setNumber(ArchetypeEdge e,
Number n)
|
void |
setWeight(ArchetypeEdge e,
int i)
Sets an edge to this weight. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object WEIGHT_DEFAULT_KEY
Method Detail |
---|
public static EdgeWeightLabeller getLabeller(Graph g)
g
-
public static boolean hasWeightLabeller(Graph g)
g
-
public static boolean hasWeightLabeller(Graph g, Object key)
public static EdgeWeightLabeller getLabeller(Graph g, Object key)
g
-
public int getWeight(ArchetypeEdge e)
e
- an edge that has been weighted.public Graph getGraph()
public void setWeight(ArchetypeEdge e, int i)
e
- the edgei
- the weight
if
- the edge is not part of the graphpublic Number removeWeight(ArchetypeEdge e)
e
,
and returns the value of this weight (or null
if there was no
such weight for this edge).
public void clear()
public Number getNumber(ArchetypeEdge e)
getNumber
in interface NumberEdgeValue
e
- the edge to examine
NumberEdgeValue.getNumber(edu.uci.ics.jung.graph.ArchetypeEdge)
public void setNumber(ArchetypeEdge e, Number n)
setNumber
in interface NumberEdgeValue
e
- the edge whose value we're settingn
- the Number to which we're setting the edgeNumberEdgeValue.setNumber(edu.uci.ics.jung.graph.ArchetypeEdge, java.lang.Number)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |