|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.graph.decorators.StringLabeller
edu.uci.ics.jung.graph.decorators.ToStringLabeller
Labels vertices by their toString. This class functions as a drop-in replacement for the default StringLabeller method. This class does not guarantee unique labels; or even consistent ones; as a result, getVertexByLabel will always return NULL.
Nested Class Summary |
Nested classes inherited from class edu.uci.ics.jung.graph.decorators.StringLabeller |
StringLabeller.UniqueLabelException |
Field Summary |
Fields inherited from class edu.uci.ics.jung.graph.decorators.StringLabeller |
DEFAULT_STRING_LABELER_KEY |
Method Summary | |
void |
assignDefaultLabels(java.util.Set vertices,
int offset)
This method is not meaningful; it throws an IllegalArgumentException |
java.lang.String |
getLabel(Vertex v)
Retunrs v.toString() |
Vertex |
getVertex(java.lang.String label)
Always returns null: this impl doesn't keep a table, and so can't meaningfully address this. |
Vertex |
removeLabel(java.lang.String string)
This method is not meaningful; it throws an IllegalArgumentException |
void |
setLabel(Vertex v,
java.lang.String l)
This method always throws an IllegalArgument exception: you cannot externally set the setstring method. |
static StringLabeller |
setLabellerTo(Graph g)
Sets the default StringLabeller of this graph to be a ToStringLabeller. |
static StringLabeller |
setLabellerTo(Graph g,
java.lang.Object key)
Sets the StringLabeller of this graph, at this key, to be a ToStringLabeller. |
Methods inherited from class edu.uci.ics.jung.graph.decorators.StringLabeller |
clear, getGraph, getLabeller, getLabeller, hasStringLabeller, hasStringLabeller |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void assignDefaultLabels(java.util.Set vertices, int offset) throws StringLabeller.UniqueLabelException
assignDefaultLabels
in class StringLabeller
vertices
- The set of Vertices to label. All must be part of this graph.offset
- The starting value to number vertices from
StringLabeller.UniqueLabelException
- Is thrown if some other vertexc is already numbered.public Vertex removeLabel(java.lang.String string)
removeLabel
in class StringLabeller
string
- public static StringLabeller setLabellerTo(Graph g, java.lang.Object key)
public static StringLabeller setLabellerTo(Graph g)
public java.lang.String getLabel(Vertex v)
getLabel
in class StringLabeller
v
- a Vertex inside the Graph.public Vertex getVertex(java.lang.String label)
getVertex
in class StringLabeller
label
- public void setLabel(Vertex v, java.lang.String l) throws StringLabeller.UniqueLabelException
setLabel
in class StringLabeller
v
- a Vertex in the labeller's graphl
- a Label to be associated with this vertex
StringLabeller.UniqueLabelException
- thrown if this label is already associated with some other
vertex.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |