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

In graph theory an relation is a relation between two nodes, often an relation is realized as a pair of nodes. More...

Inherits org.corpus_tools.salt.graph.IdentifiableElement.

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

Public Member Functions

Relation< S, T > getDelegate ()
 Returns the delegate object. More...
 
getSource ()
 Returns the source node of this relation object. More...
 
void setSource (S source)
 Returns the source node of this relation object. More...
 
getTarget ()
 Returns the target node of this relation object. More...
 
void setTarget (T target)
 Sets the target node of this relation object. More...
 
Graph getGraph ()
 Returns the container graph of this relation. More...
 
void setGraph (Graph graph)
 Sets the container graph of this relation. More...
 
Set<? extends LayergetLayers ()
 Returns all layers containing this relation. More...
 
void addLayer (Layer layer)
 Adds this relation to the passed layer. More...
 
void removeLayer (Layer layer)
 Removes this relation from the passed layer. More...
 
- Public Member Functions inherited from org.corpus_tools.salt.graph.IdentifiableElement
String getId ()
 Returns the id of this object, which is the value of the contained Identifier object. More...
 
void setId (String id)
 Creates a new Identifier object and sets its value to the passed id. More...
 
Identifier getIdentifier ()
 Returns the Identifier label for this object. More...
 
void setIdentifier (Identifier identifier)
 Sets the Identifier label for this object. 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...
 

Detailed Description

In graph theory an relation is a relation between two nodes, often an relation is realized as a pair of nodes.

This interface defines a directed and labeled relation. A directed relation is a not symmetric relation. For instance if an relation relates a node a with a node b, it is not the case for the way around. A labeled relation is an relation, which can contain labels as defined in Label. An relation always belong to 0..1 Graphs and can also be contained in one or more Layer s.

Author
florian
Parameters
<S>source node of the relation
<T>target node of the relation

Member Function Documentation

◆ addLayer()

void org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.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

Implemented in org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.

◆ getDelegate()

Relation<S, T> org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.getDelegate ( )

Returns the delegate object.

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

Returns
the delegate object

Implemented in org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.

◆ getGraph()

◆ getLayers()

Set<? extends Layer> org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.getLayers ( )

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

Implemented in org.corpus_tools.salt.core.impl.SRelationImpl< S extends SNode, T extends SNode >, org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >, and org.corpus_tools.salt.core.SRelation< S extends SNode, T extends SNode >.

◆ getSource()

S org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.getSource ( )

Returns the source node of this relation object.

Returns
source node

Implemented in org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.

◆ getTarget()

T org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.getTarget ( )

Returns the target node of this relation object.

Returns
target node

Implemented in org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.

◆ removeLayer()

void org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.removeLayer ( Layer  layer)

Removes this relation from the passed layer.

Parameters
layerfrom which this node should be removed

Implemented in org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.

◆ setGraph()

void org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.setGraph ( Graph  graph)

Sets the container graph of this relation.

Parameters
graphobject which contains this relation. Sets the container graph of this relation. The passed graph and this relation will be double chained, which means the method Graph#getRelations() will return a list containing this relation.
graphgraph which contains this relation

Implemented in org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.

◆ setSource()

void org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.setSource ( source)

Returns the source node of this relation object.

If this relation belongs to a graph, the graph's indexes will be updated automatically.

Parameters
sourcesource node

Implemented in org.corpus_tools.salt.extensions.notification.graph.impl.RelationNotifierImpl< S extends Node, T extends Node >, and org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.

◆ setTarget()

void org.corpus_tools.salt.graph.Relation< S extends Node, T extends Node >.setTarget ( target)

Sets the target node of this relation object.

If this relation belongs to a graph, the graph's indexes will be updated automatically.

Parameters
targettarget node

Implemented in org.corpus_tools.salt.extensions.notification.graph.impl.RelationNotifierImpl< S extends Node, T extends Node >, and org.corpus_tools.salt.graph.impl.RelationImpl< S extends Node, T extends Node >.