public class GlobalStringLabeller extends StringLabeller
StringLabeller.UniqueLabelException
Modifier and Type | Field and Description |
---|---|
protected static GlobalStringLabeller |
instance |
DEFAULT_STRING_LABELER_KEY, graph, labelToVertex, vertexToLabel
Modifier | Constructor and Description |
---|---|
protected |
GlobalStringLabeller() |
Modifier and Type | Method and Description |
---|---|
static StringLabeller |
getInstance() |
java.lang.String |
getLabel(ArchetypeVertex v)
Gets the String label associated with a particular Vertex.
|
static StringLabeller |
getLabeller(Graph g) |
static boolean |
hasStringLabeller(Graph g)
Checks if a labeller--any labeller--is associated with this graph.
|
static boolean |
hasStringLabeller(Graph g,
java.lang.Object key)
Checks for a labeller attached to a particular key in the graph.
|
void |
setLabel(Vertex v,
java.lang.String l)
Associates a Vertex with a Label, overrwriting any previous labels on
this vertex or vertices equal to it.
|
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.
|
assignDefaultLabels, clear, getGraph, getLabeller, getVertex, removeLabel
protected static GlobalStringLabeller instance
public static StringLabeller setLabellerTo(Graph g, java.lang.Object key)
public static StringLabeller getInstance()
GlobalStringLabeller
instancepublic static StringLabeller getLabeller(Graph g)
public static StringLabeller setLabellerTo(Graph g)
public static boolean hasStringLabeller(Graph g)
g
- The graph to check.public static boolean hasStringLabeller(Graph g, java.lang.Object key)
g
- the Graphkey
- the UserData key to which it is attachedpublic java.lang.String getLabel(ArchetypeVertex v)
getLabel
in interface VertexStringer
getLabel
in class StringLabeller
v
- a Vertexpublic void setLabel(Vertex v, java.lang.String l) throws StringLabeller.UniqueLabelException
setLabel
in class StringLabeller
v
- a Vertexl
- a Label to be associated with this vertexUniqueLabelException
- thrown if this label is already associated with some other
vertex.StringLabeller.UniqueLabelException