public interface Graph<N extends Node,R extends Relation<N,N>,L extends Layer<N,R>> extends IdentifiableElement
Nodes with v= ({label c , ... label d }) ∊ V
Relations with e= (v 1 ∊ V, v 2 ∊ V,
{label e , ... label f }) ∊ ELayers with l= (V 1 ⊆ V, E 1 ⊆ E, L 1 ⊆ L,
{label g ,.. label h }) ∊ LLabels {label a , ... label b } the graph is labeled
with.| Modifier and Type | Method and Description |
|---|---|
void |
addLayer(L layer)
Adds the passed layer to this graph.
|
void |
addNode(N node)
Adds the passed node to this graph and updates indexes.
|
void |
addRelation(Relation<? extends N,? extends N> relation)
Adds the passed relation to this graph and updates indexes.
|
boolean |
containsLayer(String layerId)
Returns whether this graph contains a
Layer corresponding to the
passed id. |
boolean |
containsNode(String nodeId)
Returns whether this graph contains a
Node corresponding to the
passed id. |
boolean |
containsRelation(String relationId)
Returns whether this graph contains an
Relation corresponding to
the passed id. |
IndexMgr |
getIndexMgr()
Returns the index manager.
|
List<R> |
getInRelations(String nodeId)
Returns all relations, which have the node corresponding to the passed id
as their target node.
|
L |
getLayer(String layerId)
Returns a layer corresponding to the passed id, if such a layer is
contained in the graph.
|
Set<L> |
getLayers()
Returns a set of layers contained by this graph.
|
N |
getNode(String nodeId)
Returns a node corresponding to the passed id, if such a node is
contained in the graph.
|
List<N> |
getNodes()
Returns a list of all relations contained in this graph.
|
List<R> |
getOutRelations(String nodeId)
Returns all relations, which have the node corresponding to the passed id
as their source node.
|
R |
getRelation(String relationId)
Returns an relation corresponding to the passed id, if such an relation
is contained in the graph.
|
List<R> |
getRelations()
Returns a list of all relations contained in this graph.
|
List<R> |
getRelations(String sourceNodeId,
String targetNodeId)
Returns all relations,which connects the two passed nodes.
|
void |
removeLayer(L layer)
Removes the passed layer from this graph and cleans all indexes.
|
void |
removeNode(N node)
Removes the passed node from this graph and cleans all indexes.
|
void |
removeRelation(Relation<? extends N,? extends N> relation)
Removes the passed relation from this graph.
|
void |
removeRelations()
Removes all relations from this graph and cleans all indexes.
|
getId, getIdentifier, setId, setIdentifieraddLabel, containsLabel, getLabel, getLabel, getLabels, getLabelsByNamespace, removeAll, removeLabel, removeLabel, sizeLabelsIndexMgr getIndexMgr()
Graph class. These indexes are:
Even further indexes can be added to the index manager.List<R> getRelations()
R getRelation(String relationId)
relationId - id of the relation to be searched forList<R> getRelations(String sourceNodeId, String targetNodeId)
sourceNodeId - the id of the source nodetargetNodeId - the id of the target nodeList<R> getInRelations(String nodeId)
nodeId - id corresponding to the node, for which all incoming relations
should be searchedList<R> getOutRelations(String nodeId)
nodeId - id corresponding to the node, for which all outgoing relations
should be searchedvoid addRelation(Relation<? extends N,? extends N> relation)
Relation.getGraph() will return this graph.relation - relation to be insertedvoid removeRelation(Relation<? extends N,? extends N> relation)
relation - relation to be removedvoid removeRelations()
boolean containsRelation(String relationId)
Relation corresponding to
the passed id.relationId - id of the node to be checkedList<N> getNodes()
N getNode(String nodeId)
nodeId - id of the node to be searched forvoid addNode(N node)
Node.getGraph() will return this graph.node - node to be insertedvoid removeNode(N node)
Node.getGraph() will return null. The double chaining between
this graph and the passed node will be cut off. If the passed node is
null nothing is done.node - the node to be removedboolean containsNode(String nodeId)
Node corresponding to the
passed id.nodeId - id of the node to be checkedL getLayer(String layerId)
layerId - id of the layer to be searched forSet<L> getLayers()
void addLayer(L layer)
Layer.getGraph() will
return this graph. If the passed layer contains nodes or relations, which
are not already contained by the graph, they will be added.layer - layer to be insertedboolean containsLayer(String layerId)
Layer corresponding to the
passed id.layerId - id of the node to be checkedvoid removeLayer(L layer)
Layer.getGraph() will return null. The double chaining between
this graph and the passed layer will be cut off. If the passed layer is
null nothing happens.layer - the layer to be removedCopyright © 2009–2019 Humboldt-Universität zu Berlin, INRIA. All rights reserved.