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.Layer< N extends Node, R extends Relation< N, N > Interface Template Reference

A layer is a grouping mechanism for nodes and relations, and can also contain further layers (called sub layers). More...

Inherits org.corpus_tools.salt.graph.IdentifiableElement.

Inherited by org.corpus_tools.salt.core.SLayer, org.corpus_tools.salt.extensions.notification.graph.impl.LayerNotifierImpl< N extends Node, R extends Relation< N, N >, and org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >.

Public Member Functions

Graph getGraph ()
 Returns the container graph of this node. More...
 
void setGraph (Graph graph)
 Sets the container graph of this node. More...
 
void addNode (N node)
 Adds the passed node to this layer. More...
 
void removeNode (N node)
 Removes the passed node from this layer. More...
 
Set< N > getNodes ()
 Returns a set of all contained nodes, in the order how the nodes were inserted. More...
 
void addRelation (Relation<? extends N, ? extends N > relation)
 Adds the passed relation to this layer. More...
 
void removeRelation (Relation<? extends N, ? extends N > relation)
 Removes the passed relation from this layer. More...
 
Set< R > getRelations ()
 Returns a set of all contained relations, in the order how the relations were inserted. 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

A layer is a grouping mechanism for nodes and relations, and can also contain further layers (called sub layers).

The containment relation implements a recursive structure for layers, to build hierarchies. In general this mechanism enables the creation of sub graphs. But note that a layer cannot be contained by itself, so cycles of layers are not possible.

Author
florian

Member Function Documentation

◆ addNode()

void org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.addNode ( node)

Adds the passed node to this layer.

The insertion order is preserved. If this layer is contained by a graph, the passed node is also added to the graph in case it was not already contained in the graph.

Parameters
nodenode to be inserted into this layer

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >, and org.corpus_tools.salt.extensions.notification.graph.impl.LayerNotifierImpl< N extends Node, R extends Relation< N, N >.

◆ addRelation()

void org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.addRelation ( Relation<? extends N, ? extends N >  relation)

Adds the passed relation to this layer.

The insertion order is preserved. If this layer is contained by a graph, the passed relation is also added to the graph in case it was not already contained in the graph.

Parameters
relationrelation to be inserted into this layer

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >, and org.corpus_tools.salt.extensions.notification.graph.impl.LayerNotifierImpl< N extends Node, R extends Relation< N, N >.

◆ getGraph()

Graph org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.getGraph ( )

Returns the container graph of this node.

Returns
graph object which contains this node.

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >.

◆ getNodes()

Set<N> org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.getNodes ( )

Returns a set of all contained nodes, in the order how the nodes were inserted.

Returns
all contained nodes

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >.

◆ getRelations()

Set<R> org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.getRelations ( )

Returns a set of all contained relations, in the order how the relations were inserted.

Returns
all contained relations

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >.

◆ removeNode()

void org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.removeNode ( node)

Removes the passed node from this layer.

If the passed relation is null, nothing is done.

Parameters
nodeto be removed

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >, and org.corpus_tools.salt.extensions.notification.graph.impl.LayerNotifierImpl< N extends Node, R extends Relation< N, N >.

◆ removeRelation()

void org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.removeRelation ( Relation<? extends N, ? extends N >  relation)

Removes the passed relation from this layer.

If the passed relation is null, nothing is done.

Parameters
relationto be removed

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >, and org.corpus_tools.salt.extensions.notification.graph.impl.LayerNotifierImpl< N extends Node, R extends Relation< N, N >.

◆ setGraph()

void org.corpus_tools.salt.graph.Layer< N extends Node, R extends Relation< N, N >.setGraph ( Graph  graph)

Sets the container graph of this node.

For double chaining between this Layer and the passed Graph object, the real insertion is done by method basicSetGraph(Graph).

Parameters
graphgraph which contains this layer

Implemented in org.corpus_tools.salt.graph.impl.LayerImpl< N extends Node, R extends Relation< N, N >.