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.RelationImpl< S extends Node, T extends Node > Class Template Reference

Inherits org.corpus_tools.salt.graph.impl.IdentifiableElementImpl, and org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.

Inherited by org.corpus_tools.salt.core.impl.SRelationImpl< S extends SNode, T extends SNode >, and org.corpus_tools.salt.extensions.notification.graph.impl.RelationNotifierImpl< S extends Node, T extends Node >.

Public Member Functions

 RelationImpl ()
 Initializes an object of type Relation.
 
 RelationImpl (Relation< S, T > delegate)
 Initializes an object of type Relation. More...
 
Relation< S, T > getDelegate ()
 {@inheritDoc Relation::getDelegate()}
 
getSource ()
 {@inheritDoc Relation::getSource()}
 
void setSource (S source)
 {@inheritDoc Relation::setSource(Node)} Notifies the graph, about the change of the source.
 
getTarget ()
 {@inheritDoc Relation::getTarget()}
 
void setTarget (T target)
 {@inheritDoc Relation::setTarget(Node)} Notifies the graph, about the change of the target.
 
Graph getGraph ()
 {@inheritDoc Relation::getGraph()}
 
void setGraph (Graph graph)
 {@inheritDoc Relation::setGraph(Graph)}
 
void basicSetGraph_WithoutRemoving (Graph graph)
 Same as basicSetGraph(Graph) but does not remove this relation from old graph, if it was not equal to the passed graph. More...
 
Set<? extends LayergetLayers ()
 Returns all layers containing this relation.This is a computed set and only works, when this relation is contained in a graph. If this list is used multiple times, it makes sense to store that set.
Returns
a set of layers containing this relation

 
void addLayer (Layer layer)
 Adds this relation to the passed layer.If this relation is not already contained in the layer's graph, it will be added to the graph.
Parameters
layerto which this node should be added

Since the method getLayers() retrieves all layers by accessing the layers in graph, this class does not contain an own collection of layers.
 
void removeLayer (Layer layer)
 Removes this relation from the passed layer.
Parameters
layerfrom which this node should be removed

Since the method getLayers() retrieves all layers by accessing the layers in graph, this class does not contain an own collection of layers.
 
- Public Member Functions inherited from org.corpus_tools.salt.graph.impl.IdentifiableElementImpl
 IdentifiableElementImpl (IdentifiableElement delegate)
 
Identifier getIdentifier ()
 {@inheritDoc IdentifiableElement::getIdentifier()}
 
void setIdentifier (Identifier identifier)
 {@inheritDoc IdentifiableElement::setIdentifier(Identifier)}
 
void removeLabel (String qName)
 {@inheritDoc LabelableElement::removeLabel(String)} In case the passed qualified name is equal to SaltUtil#LABEL_ID_QNAME the internal reference to identifier is set to null.
 
String getId ()
 {@inheritDoc IdentifiableElement::getId()}
 
void setId (String id)
 {@inheritDoc IdentifiableElement::setId(String)}
 
String toString ()
 
- Public Member Functions inherited from org.corpus_tools.salt.graph.impl.LabelableElementImpl
 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 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()}
 

Protected Member Functions

void basicSetGraph (Graph graph)
 This is an internally used method. More...
 

Protected Attributes

source = null
 source node of this relation.
 
Graph graph = null
 container graph
 
- Protected Attributes inherited from org.corpus_tools.salt.graph.impl.LabelableElementImpl
LabelableElement delegate = null
 A delegate object of the same type. More...
 

Additional Inherited Members

- Static Public Attributes inherited from org.corpus_tools.salt.graph.impl.LabelableElementImpl
static final int EXPECTED_NUMBER_OF_LABELS = 5
 Determines the expected number of labels.
 

Constructor & Destructor Documentation

◆ RelationImpl()

org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.RelationImpl ( Relation< S, T >  delegate)

Initializes an object of type Relation.

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

Parameters
adelegate object of the same type.

Member Function Documentation

◆ basicSetGraph()

void org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.basicSetGraph ( Graph  graph)
protected

This is an internally used method.

To implement a double chaining of Graph and Relation object when an relation is inserted into this graph and to avoid an endless invocation the insertion of an relation is splited into the two methods setGraph(Graph) and basicSetGraph(Graph). The invocation of methods is implement as follows:

Graph#addRelation(Relation)                      Relation#setGraph(Graph)
        ||             \ /                   ||
        ||              X                    ||
        \/             / \                   \/
Graph#basicAddRelation(Relation)            Relation#basicSetGraph(Graph)

That means method setGraph(Graph) calls basicSetGraph(Graph) and Graph#basicAddRelation(Relation). And method setGraph(Graph) calls Graph#basicAddRelation(Relation) and Relation#basicSetGraph(Graph).

Parameters
graphgraph which contains this relation

◆ basicSetGraph_WithoutRemoving()

void org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.basicSetGraph_WithoutRemoving ( Graph  graph)

Same as basicSetGraph(Graph) but does not remove this relation from old graph, if it was not equal to the passed graph.

Parameters
graph