public class SGraphImpl extends GraphImpl<SNode,SRelation<SNode,SNode>,SLayer> implements SGraph
SGraph.GRAPH_TRAVERSE_TYPE| Modifier and Type | Field and Description |
|---|---|
protected SFeature |
name
The feature object containing the name of the node
|
approximatedNodeDegree, expectedNodes, expectedRelations, indexMgrEXPECTED_NUMBER_OF_LABELS| Constructor and Description |
|---|
SGraphImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotation(SAnnotation annotation)
Adds the passed annotation to this container.
|
void |
addFeature(SFeature feature)
Adds the passed feature to this container.
|
void |
addLayer(SLayer layer)
Adds the passed layer to this graph.
|
void |
addMetaAnnotation(SMetaAnnotation metaAnnotation)
Adds the passed meta annotation to this container.
|
void |
addProcessingAnnotation(SProcessingAnnotation annotation)
Adds the passed processing-annotation to this container.
|
SAnnotation |
createAnnotation(String namespace,
String name,
Object value)
Creates and returns an annotation having the passed namespace, name and
value.
|
Set<SAnnotation> |
createAnnotations(String annotationString)
This method parses the given annotation String and adds an
SAnnotation object for each annotation being contained in that
string to the given SAnnotationContainer object. |
SFeature |
createFeature(String namespace,
String name,
Object value)
Creates and returns an feature having the passed namespace, name and
value.
|
Set<SFeature> |
createFeatures(String featureString)
This method parses the given feature String and adds an
SFeature
object for each feature being contained in that string to the given
SAnnotationContainer object. |
SMetaAnnotation |
createMetaAnnotation(String namespace,
String name,
Object value)
Creates and returns a meta annotation having the passed namespace, name
and value.
|
Set<SMetaAnnotation> |
createMetaAnnotations(String annotationString)
This method parses the given meta annotation String and adds an
SMetaAnnotation object for each meta annotation being contained
in that string to the given SAnnotationContainer object. |
SProcessingAnnotation |
createProcessingAnnotation(String namespace,
String name,
Object value)
Creates and returns a processing-annotation having the passed namespace,
name and value.
|
Set<SProcessingAnnotation> |
createProcessingAnnotations(String annotationString)
This method parses the given processing-annotation String and adds an
SProcessingAnnotation object for each processing-annotation being
contained in that string to the given SAnnotationContainer
object. |
SAnnotation |
getAnnotation(String qName)
Returns an annotation having the passed qualified name, if this container
contains such an annotation.
|
SAnnotation |
getAnnotation(String namespace,
String name)
Returns an annotation having the passed qualified name, if this container
contains such an annotation.
|
<A extends SAnnotation> |
getAnnotations()
Returns all annotations contained by this object.
|
SFeature |
getFeature(String qName)
Returns an feature having the passed qualified name, if this container
contains such an feature.
|
SFeature |
getFeature(String namespace,
String name)
Returns an feature having the passed qualified name, if this container
contains such an feature.
|
<A extends SFeature> |
getFeatures()
Returns all features contained by this object.
|
List<SLayer> |
getLayerByName(String layerName)
Searches for a layer or a set of layers having the given layer name.
|
List<SNode> |
getLeafs()
Returns all leaf nodes, if exist.
|
SMetaAnnotation |
getMetaAnnotation(String qName)
Returns a meta annotation having the passed qualified name, if this
container contains such a meta annotation.
|
<A extends SMetaAnnotation> |
getMetaAnnotations()
Returns all meta annotations contained by this object.
|
String |
getName()
Returns the name of this element.
|
List<SNode> |
getNodesByName(String nodeName)
Searches for a node or a set of nodes having the given node name.
|
org.eclipse.emf.common.util.URI |
getPath()
Returns the id of this object as a URI path If no Id exists, null is
returned.
|
SProcessingAnnotation |
getProcessingAnnotation(String qName)
Returns a processing-annotation having the passed qualified name, if this
container contains such a processing-annotation.
|
<A extends SProcessingAnnotation> |
getProcessingAnnotations()
Returns all processing-annotations contained by this object.
|
List<SRelation> |
getRelationsByName(String relationName)
Searches for a relation or a set of relations having the given relation
name.
|
List<SNode> |
getRoots()
Returns all root nodes, if exist.
|
Iterator<SAnnotation> |
iterator_SAnnotation()
Returns an iterator to iterate over the
SAnnotation objects
contained by this container. |
Iterator<SFeature> |
iterator_SFeature()
Returns an iterator to iterate over the
SFeature objects
contained by this container. |
Iterator<SMetaAnnotation> |
iterator_SMetaAnnotation()
Returns an iterator to iterate over the
SMetaAnnotation objects
contained by this container. |
Iterator<SProcessingAnnotation> |
iterator_SProcessingAnnotation()
Returns an iterator to iterate over the
SProcessingAnnotation
objects contained by this container. |
void |
removeLabel(String qName)
Removes the label having the passed qName.
|
void |
setName(String name)
Sets the name of the element.
|
void |
traverse(List<? extends SNode> startNodes,
SGraph.GRAPH_TRAVERSE_TYPE traverseType,
String traverseId,
GraphTraverseHandler traverseHandler,
boolean isCycleSafe)
Attention: When isCycleSafe is set to false, this
method does not take care about cycles, and it eventually runs into
endless loops.
|
void |
traverse(List<SNode> startNodes,
SGraph.GRAPH_TRAVERSE_TYPE traverseType,
String traverseId,
GraphTraverseHandler traverseHandler)
Traverses a graph in the given order traverseType and starts traversing
with the given startNodes.
|
addNode, addRelation, basicAddLayer, basicAddNode, basicAddRelation, basicRemoveLayer, basicRemoveNode, basicRemoveRelation, containsLayer, containsNode, containsRelation, getIndexMgr, getInRelations, getLayer, getLayers, getNode, getNodes, getOutRelations, getRelation, getRelations, getRelations, init, removeLayer, removeNode, removeRelation, removeRelations, updategetId, getIdentifier, setId, setIdentifier, toStringaddLabel, basicAddLabel, basicRemoveLabel, containsLabel, getLabel, getLabel, getLabels, getLabelsByNamespace, removeAll, removeLabel, sizeLabelsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddNode, addRelation, containsLayer, containsNode, containsRelation, getIndexMgr, getInRelations, getLayer, getLayers, getNode, getNodes, getOutRelations, getRelation, getRelations, getRelations, removeLayer, removeNode, removeRelation, removeRelationsgetId, getIdentifier, setId, setIdentifieraddLabel, containsLabel, getLabel, getLabel, getLabels, getLabelsByNamespace, removeAll, removeLabel, sizeLabelsprotected SFeature name
public void addLayer(SLayer 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.public List<SNode> getNodesByName(String nodeName)
getNodesByName in interface SGraphnodeName - Name of the node to search forpublic List<SRelation> getRelationsByName(String relationName)
getRelationsByName in interface SGraphrelationName - Name of the relation to search forpublic List<SLayer> getLayerByName(String layerName)
getLayerByName in interface SGraphlayerName - Name of the layer to search forpublic List<SNode> getRoots()
public List<SNode> getLeafs()
public void traverse(List<SNode> startNodes, SGraph.GRAPH_TRAVERSE_TYPE traverseType, String traverseId, GraphTraverseHandler traverseHandler)
GraphTraverseHandler#checkConstraint(GRAPH_TRAVERSE_MODE, String, Edge, Node, long)
of the given callback handler traverseHandler, second the method
GraphTraverseHandler#nodeReached(GRAPH_TRAVERSE_MODE, String, Node, Edge, Node, long)
is invoked. When a node was left, the method
GraphTraverseHandler#nodeLeft(GRAPH_TRAVERSE_MODE, String, Node, Edge, Node, long)
is invoked. When calling these methods, the traverseId will be passed, so
that the callback handler knows which traversal is meant. This is
helpful, in case of a single callback handler is used for more than one
traversal at the same time. This method throws a
GraphTraverserException in case of the graph contains a cycle. A
cycle means a path containing the same node twice.traverse in interface SGraphstartNodes - list of nodes at which the traversal shall starttraverseType - type of traversingtraverseId - identification for callback handler, in case of more than one
traversal is running at the same time with the same callback
handlertraverseHandler - callback handler, on which the three methods will be invokedpublic void traverse(List<? extends SNode> startNodes, SGraph.GRAPH_TRAVERSE_TYPE traverseType, String traverseId, GraphTraverseHandler traverseHandler, boolean isCycleSafe)
public void removeLabel(String qName)
IdentifiableElementImplSaltUtil.LABEL_ID_QNAME the internal reference to
IdentifiableElementImpl.identifier is set to null.removeLabel in interface LabelableElementremoveLabel in class IdentifiableElementImplqName - qualified name of the Label to be removedpublic String getName()
getName in interface SNamedElementpublic void setName(String name)
setName in interface SNamedElementname - name of the element.public SAnnotation createAnnotation(String namespace, String name, Object value)
createAnnotation in interface SAnnotationContainernamespace - namespace of the annotationname - name of the annotationvalue - value of the annotationpublic Set<SAnnotation> createAnnotations(String annotationString)
SAnnotation object for each annotation being contained in that
string to the given SAnnotationContainer object. The syntax for
Annotations is:createAnnotations in interface SAnnotationContainerannotationString - String containing the annotationspublic void addAnnotation(SAnnotation annotation)
addAnnotation in interface SAnnotationContainerannotation - annotation to be addedpublic <A extends SAnnotation> Set<A> getAnnotations()
Attention: This method is slow, since it iterates over all contained
labels and creates a new list of all SAnnotation objects. Use
SAnnotationContainer.iterator_SAnnotation() instead.
getAnnotations in interface SAnnotationContainerpublic SAnnotation getAnnotation(String qName)
getAnnotation in interface SAnnotationContainerqName - the qualified of the annotation. A qualified name consists of:
namespace+'::'+namepublic SAnnotation getAnnotation(String namespace, String name)
getAnnotation in interface SAnnotationContainernamespace - the namespace of the annotation.name - the name of the annotation.public Iterator<SAnnotation> iterator_SAnnotation()
SAnnotation objects
contained by this container. Using an iterator is slightly faster than
SAnnotationContainer.getAnnotations().iterator_SAnnotation in interface SAnnotationContainerSAnnotation objectspublic void addMetaAnnotation(SMetaAnnotation metaAnnotation)
addMetaAnnotation in interface SAnnotationContainermetaAnnotation - meta annotation to be addedpublic SMetaAnnotation createMetaAnnotation(String namespace, String name, Object value)
createMetaAnnotation in interface SAnnotationContainernamespace - namespace of the meta annotationname - name of the meta annotationvalue - value of the meta annotationpublic Set<SMetaAnnotation> createMetaAnnotations(String annotationString)
SMetaAnnotation object for each meta annotation being contained
in that string to the given SAnnotationContainer object. The
syntax for meta annotations is:createMetaAnnotations in interface SAnnotationContainerannotationString - String containing the meta annotationspublic <A extends SMetaAnnotation> Set<A> getMetaAnnotations()
SAnnotationContainer
Attention: This method is slow, since it iterates over all contained
labels and creates a new list of all SAnnotation objects. Use
SAnnotationContainer.iterator_SAnnotation() instead.
getMetaAnnotations in interface SAnnotationContainerpublic SMetaAnnotation getMetaAnnotation(String qName)
SAnnotationContainergetMetaAnnotation in interface SAnnotationContainerqName - the qualified of the meta annotation. A qualified name
consists of: namespace+'::'+namepublic Iterator<SMetaAnnotation> iterator_SMetaAnnotation()
SAnnotationContainerSMetaAnnotation objects
contained by this container. Using an iterator is slightly faster than
SAnnotationContainer.getMetaAnnotations().iterator_SMetaAnnotation in interface SAnnotationContainerSAnnotation objectspublic SProcessingAnnotation createProcessingAnnotation(String namespace, String name, Object value)
createProcessingAnnotation in interface SAnnotationContainernamespace - namespace of the processing-annotationname - name of the processing-annotationvalue - value of the processing-annotationpublic Set<SProcessingAnnotation> createProcessingAnnotations(String annotationString)
SProcessingAnnotation object for each processing-annotation being
contained in that string to the given SAnnotationContainer
object. The syntax for processing-annotations is:createProcessingAnnotations in interface SAnnotationContainerannotationString - String containing the processing-annotationspublic void addProcessingAnnotation(SProcessingAnnotation annotation)
addProcessingAnnotation in interface SAnnotationContainerannotation - annotation to be addedpublic <A extends SProcessingAnnotation> Set<A> getProcessingAnnotations()
Attention: This method is slow, since it iterates over all contained
labels and creates a new list of all SProcessingAnnotation
objects. Use SAnnotationContainer.iterator_SProcessingAnnotation() instead.
getProcessingAnnotations in interface SAnnotationContainerpublic SProcessingAnnotation getProcessingAnnotation(String qName)
getProcessingAnnotation in interface SAnnotationContainerqName - the qualified of the processing-annotation. A qualified name
consists of: namespace+'::'+namepublic Iterator<SProcessingAnnotation> iterator_SProcessingAnnotation()
SProcessingAnnotation
objects contained by this container. Using an iterator is slightly faster
than SAnnotationContainer.getProcessingAnnotations().iterator_SProcessingAnnotation in interface SAnnotationContainerSAnnotation objectspublic SFeature createFeature(String namespace, String name, Object value)
createFeature in interface SAnnotationContainernamespace - namespace of the featurename - name of the featurevalue - value of the featurepublic Set<SFeature> createFeatures(String featureString)
SFeature
object for each feature being contained in that string to the given
SAnnotationContainer object. The syntax for Features is:createFeatures in interface SAnnotationContainerfeatureString - String containing the featurespublic void addFeature(SFeature feature)
addFeature in interface SAnnotationContainerfeature - feature to be addedpublic <A extends SFeature> Set<A> getFeatures()
Attention: This method is slow, since it iterates over all contained
labels and creates a new list of all SFeature objects. Use
SAnnotationContainer.iterator_SFeature() instead.
getFeatures in interface SAnnotationContainerpublic SFeature getFeature(String qName)
getFeature in interface SAnnotationContainerqName - the qualified of the feature. A qualified name consists of:
namespace+'::'+namepublic SFeature getFeature(String namespace, String name)
getFeature in interface SAnnotationContainernamespace - the namespace of the feature.name - the name of the feature.public Iterator<SFeature> iterator_SFeature()
SFeature objects
contained by this container. Using an iterator is slightly faster than
SAnnotationContainer.getFeatures().iterator_SFeature in interface SAnnotationContainerSFeature objectspublic org.eclipse.emf.common.util.URI getPath()
getPath in interface SPathElementCopyright © 2009–2016 Humboldt-Universität zu Berlin, INRIA. All rights reserved.