Salt  3.4.2
A powerful, tagset-independent and theory-neutral meta model and API for storing, manipulating, and representing nearly all types of linguistic data .
org.corpus_tools.salt.graph.Label Interface Reference

A label is an attribute-value-pair and can belong to either a Node, an Relation, a Graph, a Layer or another Label as shown in . More...

Inherits org.corpus_tools.salt.graph.LabelableElement, and org.corpus_tools.salt.util.Copyable< T >.

Inherited by org.corpus_tools.salt.core.SAbstractAnnotation, org.corpus_tools.salt.extensions.notification.graph.impl.LabelNotifierImpl, org.corpus_tools.salt.graph.Identifier, and org.corpus_tools.salt.graph.impl.LabelImpl.

Public Member Functions

String getNamespace ()
 Returns the optional namespace of the label. More...
 
void setNamespace (String namespace)
 Sets the optional namespace of the label. More...
 
String getName ()
 Returns the name of the label. More...
 
void setName (String name)
 Sets the name of the label. More...
 
String getQName ()
 Returns the qName of this label, which is the combination of namespace and name must be unique in the containing object. More...
 
void setQName (String qName)
 Sets the qName of this label, which is the combination of namespace and name must be unique in the containing object. More...
 
Object getValue ()
 Returns the value of this label. More...
 
void setValue (Object value)
 Sets the value of this label. More...
 
public< C extends LabelableElement > C getContainer ()
 Returns the container element, which contains this label. More...
 
public< C extends LabelableElement > void setContainer (C container)
 Sets the container element, which contains this label. More...
 
- Public Member Functions inherited from org.corpus_tools.salt.graph.LabelableElement
Collection< LabelgetLabels ()
 Returns all labels being contained by this object. More...
 
void addLabel (Label label)
 Adds the given Label object to the list of labels. More...
 
Label getLabel (String namespace, String name)
 Returns a label having the passed namespace and name, if such a label is contained by this object. More...
 
Label getLabel (String qName)
 Returns a label having the passed qualified name. More...
 
void removeLabel (String qName)
 Removes the label having the passed qName. More...
 
void removeLabel (String namespace, String name)
 Removes a Label object from the list of labels of this object. More...
 
void removeAll ()
 Removes all Label objects.
 
Set< LabelgetLabelsByNamespace (String namespace)
 Returns a set containing all Label objects having the given namespace. More...
 
boolean containsLabel (String qName)
 Checks if this object has a Label object in its list having the given qualified name. More...
 
Integer sizeLabels ()
 returns the number of Label objects contained by this object. More...
 
- Public Member Functions inherited from org.corpus_tools.salt.util.Copyable< T >
copy (T other)
 Takes a new 'empty' object and sets all its fields by copying by value. More...
 

Static Public Attributes

static final String NS_SEPERATOR = "::"
 Separator between namespace and name: qname= NAMESPACE {@value NS_SEPERATOR} NAME.
 

Detailed Description

A label is an attribute-value-pair and can belong to either a Node, an Relation, a Graph, a Layer or another Label as shown in .

An attribute-value-pair is a triple which consists of a namespace, a name and a value (namespace::name=value). The combination of name and namespace is used to identify a label and therefore must be unique. The namespace is an optional value, to distinguish in case of there are two labels having the same name.

When a label is added to another container, it is removed from it's former container.

Author
florian
Parameters
<V>this parameter determines the type of the value of this label.

Member Function Documentation

◆ getContainer()

public<C extends LabelableElement> C org.corpus_tools.salt.graph.Label.getContainer ( )

Returns the container element, which contains this label.

The label and the container are double chained, which means when a label is added to the container, the labels container is automatically set to it or even removed.

Returns
container of this label

Implemented in org.corpus_tools.salt.graph.impl.LabelImpl.

◆ getName()

String org.corpus_tools.salt.graph.Label.getName ( )

Returns the name of the label.

The combination of namespace and name must be unique in the containing object.

Returns
name of the label

Implemented in org.corpus_tools.salt.graph.impl.LabelImpl.

◆ getNamespace()

String org.corpus_tools.salt.graph.Label.getNamespace ( )

Returns the optional namespace of the label.

The combination of namespace and name must be unique in the containing object.

Returns
namespace

Implemented in org.corpus_tools.salt.graph.impl.LabelImpl.

◆ getQName()

String org.corpus_tools.salt.graph.Label.getQName ( )

Returns the qName of this label, which is the combination of namespace and name must be unique in the containing object.

Returns
NAMESPACE {@value NS_SEPERATOR} NAME

Implemented in org.corpus_tools.salt.graph.impl.LabelImpl.

◆ getValue()

Object org.corpus_tools.salt.graph.Label.getValue ( )

Returns the value of this label.

Returns
generic value of this label.

Implemented in org.corpus_tools.salt.graph.impl.LabelImpl.

◆ setContainer()

public<C extends LabelableElement> void org.corpus_tools.salt.graph.Label.setContainer ( container)

Sets the container element, which contains this label.

The label and the container are double chained, which means when a label is added to the container, the labels container is automatically set to it or even removed. Passing a null value means removing the label from the container.

Parameters
valuecontainer of this label

◆ setName()

◆ setNamespace()

◆ setQName()

void org.corpus_tools.salt.graph.Label.setQName ( String  qName)

Sets the qName of this label, which is the combination of namespace and name must be unique in the containing object.

Parameters
qnamethe qname is splitted into NAMESPACE {@value NS_SEPERATOR} NAME

Implemented in org.corpus_tools.salt.extensions.notification.graph.impl.LabelNotifierImpl, and org.corpus_tools.salt.graph.impl.LabelImpl.

◆ setValue()