|
|||||||||||
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, graph, labelToVertex, vertexToLabel |
Constructor Summary | |
protected |
ToStringLabeller(Graph g)
|
Method Summary | |
void |
assignDefaultLabels(Set vertices,
int offset)
This method is not meaningful; it throws an IllegalArgumentException |
String |
getLabel(ArchetypeVertex v)
Retunrs v.toString() |
Vertex |
getVertex(String label)
Always returns null: this impl doesn't keep a table, and so can't meaningfully address this. |
Vertex |
removeLabel(String string)
This method is not meaningful; it throws an IllegalArgumentException |
void |
setLabel(Vertex v,
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,
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected ToStringLabeller(Graph g)
g
- Method Detail |
public void assignDefaultLabels(Set vertices, int offset)
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 frompublic Vertex removeLabel(String string)
removeLabel
in class StringLabeller
string
- public static StringLabeller setLabellerTo(Graph g, Object key)
public static StringLabeller setLabellerTo(Graph g)
public String getLabel(ArchetypeVertex v)
getLabel
in interface VertexStringer
getLabel
in class StringLabeller
v
- a Vertex inside the Graph.public Vertex getVertex(String label)
getVertex
in class StringLabeller
label
- public void setLabel(Vertex v, 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 |