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.LabelableElement Interface Reference

This interface defines a container to hold Label objects and makes them accessible. More...

Inherits Serializable.

Inherited by org.corpus_tools.salt.core.SAnnotationContainer, org.corpus_tools.salt.graph.IdentifiableElement, org.corpus_tools.salt.graph.impl.LabelableElementImpl, and org.corpus_tools.salt.graph.Label.

Public Member Functions

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...
 

Detailed Description

This interface defines a container to hold Label objects and makes them accessible.

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

Author
florian

Member Function Documentation

◆ addLabel()

◆ containsLabel()

boolean org.corpus_tools.salt.graph.LabelableElement.containsLabel ( String  qName)

Checks if this object has a Label object in its list having the given qualified name.

Parameters
fullNamethe full qualified name of the label to be looked for
Returns
true, if this object contains such a Label object, false otherwise

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

◆ getLabel() [1/2]

Label org.corpus_tools.salt.graph.LabelableElement.getLabel ( String  namespace,
String  name 
)

Returns a label having the passed namespace and name, if such a label is contained by this object.

Parameters
namespacenamespace of the Label to be searched for
namename of the Label to be searched for
Returns
Label object

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

◆ getLabel() [2/2]

Label org.corpus_tools.salt.graph.LabelableElement.getLabel ( String  qName)

Returns a label having the passed qualified name.

Therefore the qName is splitted into namespace and name.

Parameters
qNamethe qualified name to be splitted
Returns
Label object

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

◆ getLabels()

Collection<Label> org.corpus_tools.salt.graph.LabelableElement.getLabels ( )

Returns all labels being contained by this object.

Returns
set of all Label objects

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

◆ getLabelsByNamespace()

Set<Label> org.corpus_tools.salt.graph.LabelableElement.getLabelsByNamespace ( String  namespace)

Returns a set containing all Label objects having the given namespace.

If no such Label was found or the passed namespace was empty, an empty list is returned.

Parameters
nsthe namespace of Label objects to be looked for.
Returns
a list of Label objects if this object contains Label objects having the given namespace, null otherwise.

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

◆ removeLabel() [1/2]

void org.corpus_tools.salt.graph.LabelableElement.removeLabel ( String  namespace,
String  name 
)

Removes a Label object from the list of labels of this object.

The Label object to be removed is identified by given namespace and name.

Parameters
namespacethe namespace of the object to be removed
namethe name of the object to be removed

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

◆ removeLabel() [2/2]

◆ sizeLabels()

Integer org.corpus_tools.salt.graph.LabelableElement.sizeLabels ( )

returns the number of Label objects contained by this object.

Returns
number of Label objects

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