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.impl.LabelableElementImpl Class Referenceabstract

This class is an abstract container containing a set of Label objects. More...

Inherits org.corpus_tools.salt.graph.LabelableElement, and Serializable.

Inherited by org.corpus_tools.salt.graph.impl.IdentifiableElementImpl, and org.corpus_tools.salt.graph.impl.LabelImpl.

Public Member Functions

 LabelableElementImpl (LabelableElement delegatee)
 Initializes a new object and sets an internal delegate. More...
 
Collection< LabelgetLabels ()
 {@inheritDoc LabelableElement::getLabels()}
 
Label getLabel (String qName)
 {@inheritDoc LabelableElement::getLabel(String)}
 
Label getLabel (String namespace, String name)
 {@inheritedDoc LabelableElement::getLabel(String, String)}
 
Set< LabelgetLabelsByNamespace (String namespace)
 {@inheritDoc LabelableElement::getLabelsByNamespace(String)}
 
void addLabel (Label label)
 Adds the given Label object to the list of labels.
Parameters
labelthe Label object to be added

 
void basicAddLabel (Label label)
 This is an internally used method. More...
 
void removeLabel (String qName)
 {@inheritDoc LabelableElement::removeLabel(String)}
 
void basicRemoveLabel (String qName)
 This is an internally used method. More...
 
void removeLabel (String namespace, String name)
 {@inheritDoc LabelableElement::removeLabel(String, String))}
 
void removeAll ()
 {@inheritDoc LabelableElement::removeAll()}
 
boolean containsLabel (String qName)
 {@inheritDoc LabelableElement::containsLabel(String)}
 
Integer sizeLabels ()
 {@inheritDoc LabelableElement::sizeLabels()}
 

Static Public Attributes

static final int EXPECTED_NUMBER_OF_LABELS = 5
 Determines the expected number of labels.
 

Protected Member Functions

LabelableElement getDelegate ()
 Returns the delegate object. More...
 

Protected Attributes

LabelableElement delegate = null
 A delegate object of the same type. More...
 

Detailed Description

This class is an abstract container containing a set of Label objects.

Author
florian

Constructor & Destructor Documentation

◆ LabelableElementImpl()

org.corpus_tools.salt.graph.impl.LabelableElementImpl.LabelableElementImpl ( LabelableElement  delegatee)

Initializes a new object and sets an internal delegate.

This means, all method invocations are passed to the delegate.

Parameters
delegateeobject to pass method invocations to.

Member Function Documentation

◆ basicAddLabel()

void org.corpus_tools.salt.graph.impl.LabelableElementImpl.basicAddLabel ( Label  label)

This is an internally used method.

To implement a double chaining of LabelableElement and label object. When a label is inserted into this container and to avoid an endless invocation the insertion of a label is split into the two methods addLabel(Label) and basicAddLabel(Label). The invocation of methods is implement as follows:

addLabel(Label)                      Label#setContainer(LabelableElement)
        ||             \ /                   ||
        ||              X                    ||
        \/             / \                   \/
basicAddLabel(Label)            LabelImpl#basicSetLabelableElement(LabelableElement)

That means method addLabel(Label) calls basicAddLabel(Label) and Label#basicSetGraph(Graph). And method Label#setContainer(LabelableElement) calls basicAddLabel(Label) and LabelImpl#basicSetLabelableElement(LabelableElement).

Parameters
labellabel to be inserted

◆ basicRemoveLabel()

void org.corpus_tools.salt.graph.impl.LabelableElementImpl.basicRemoveLabel ( String  qName)

This is an internally used method.

To implement a double chaining of LabelableElement and label object. When a label is inserted into this container and to avoid an endless invocation the insertion of a label is split into the two methods removeLabel(String) and basicRemoveLabel(String). The invocation of methods is implement as follows:

removeLabel(String)                      Label#setContainer(LabelableElement)
        ||             \ /                   ||
        ||              X                    ||
        \/             / \                   \/
basicRemoveLabel(STring)            LabelImpl#basicSetLabelableElement(LabelableElement)

That means method removeLabel(String) calls basicRemoveLabel(String) and Label#basicSetGraph(Graph). And method Label#setContainer(LabelableElement) calls basicRemoveLabel(String) and LabelImpl#basicSetLabelableElement(LabelableElement).

Parameters
labellabel to be inserted

◆ getDelegate()

LabelableElement org.corpus_tools.salt.graph.impl.LabelableElementImpl.getDelegate ( )
protected

Member Data Documentation

◆ delegate

LabelableElement org.corpus_tools.salt.graph.impl.LabelableElementImpl.delegate = null
protected

A delegate object of the same type.

If delegate is not null, all functions of this method are delegated to the delegate object. Setting delegate makes this object to a container.