public interface SGraph extends Graph<SNode,SRelation<SNode,SNode>,SLayer>, SAnnotationContainer, SNamedElement, SPathElement
| Modifier and Type | Interface and Description |
|---|---|
static class |
SGraph.GRAPH_TRAVERSE_TYPE
The
SGraph.GRAPH_TRAVERSE_TYPE determines the the traversal order. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
List<SNode> |
getNodesByName(String nodeName)
Searches for a node or a set of nodes having the given node name.
|
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.
|
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.
|
addLayer, addNode, 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, removeLabel, sizeLabelsaddAnnotation, addFeature, addMetaAnnotation, addProcessingAnnotation, createAnnotation, createAnnotations, createFeature, createFeatures, createMetaAnnotation, createMetaAnnotations, createProcessingAnnotation, createProcessingAnnotations, getAnnotation, getAnnotation, getAnnotations, getFeature, getFeature, getFeatures, getMetaAnnotation, getMetaAnnotations, getProcessingAnnotation, getProcessingAnnotations, iterator_SAnnotation, iterator_SFeature, iterator_SMetaAnnotation, iterator_SProcessingAnnotationgetName, setNamegetPathList<SNode> getRoots()
List<SNode> getLeafs()
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.startNodes - 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 invokedvoid traverse(List<? extends SNode> startNodes, SGraph.GRAPH_TRAVERSE_TYPE traverseType, String traverseId, GraphTraverseHandler traverseHandler, boolean isCycleSafe)
List<SNode> getNodesByName(String nodeName)
nodeName - Name of the node to search forList<SRelation> getRelationsByName(String relationName)
relationName - Name of the relation to search forCopyright © 2009–2016 Humboldt-Universität zu Berlin, INRIA. All rights reserved.