public class ToStringLabeller extends StringLabeller
StringLabeller.UniqueLabelExceptionDEFAULT_STRING_LABELER_KEY, graph, labelToVertex, vertexToLabel| Modifier | Constructor and Description |
|---|---|
protected |
ToStringLabeller(Graph g) |
| Modifier and Type | Method and Description |
|---|---|
void |
assignDefaultLabels(java.util.Set vertices,
int offset)
This method is not meaningful; it throws an IllegalArgumentException
|
java.lang.String |
getLabel(ArchetypeVertex 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.
|
clear, getGraph, getLabeller, getLabeller, hasStringLabeller, hasStringLabellerprotected ToStringLabeller(Graph g)
g - public void assignDefaultLabels(java.util.Set vertices,
int offset)
assignDefaultLabels in class StringLabellervertices - The set of Vertices to label. All must be part of this graph.offset - The starting value to number vertices frompublic Vertex removeLabel(java.lang.String string)
removeLabel in class StringLabellerpublic static StringLabeller setLabellerTo(Graph g, java.lang.Object key)
public static StringLabeller setLabellerTo(Graph g)
public java.lang.String getLabel(ArchetypeVertex v)
getLabel in interface VertexStringergetLabel in class StringLabellerv - a Vertex inside the Graph.public Vertex getVertex(java.lang.String label)
getVertex in class StringLabellerpublic void setLabel(Vertex v, java.lang.String l) throws StringLabeller.UniqueLabelException
setLabel in class StringLabellerv - a Vertex in the labeller's graphl - a Label to be associated with this vertexStringLabeller.UniqueLabelException - thrown if this label is already associated with some other
vertex.