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 .
|
Inherits org.corpus_tools.salt.core.impl.SGraphImpl, and org.corpus_tools.salt.common.SDocumentGraph.
Public Member Functions | |||||||||||
SDocumentGraphImpl () | |||||||||||
Initializes an object of type SDocumentGraphImpl. | |||||||||||
SDocumentGraphImpl (Graph delegate) | |||||||||||
Initializes an object of type SDocumentGraphImpl. More... | |||||||||||
void | addRelation (Relation<? extends SNode, ? extends SNode > relation) | ||||||||||
void | addNode (SNode node) | ||||||||||
SDocument | getDocument () | ||||||||||
Returns the SDocument object containing this graph object.The SDocument object is linked via a SFeature object having the namespace {@value SaltFactory::NAMESPACE_SALT} and the name {@value SFEATURE_NAME::SDOCUMENT}.
| |||||||||||
void | setDocument (SDocument document) | ||||||||||
Sets the SDocument object as a container for this graph.The given SDocument object is linked via a SFeature object having the namespace {@value SaltFactory::NAMESPACE_SALT} and the name {@value SFEATURE_NAME::SDOCUMENT}.
| |||||||||||
void | basic_setDocument (SDocument document) | ||||||||||
This is an internally used method. More... | |||||||||||
List< STextualDS > | getTextualDSs () | ||||||||||
Returns all primary texts contained in this document structure.
| |||||||||||
List< SRelation > | getRelations (SALT_TYPE type) | ||||||||||
Returns all relations of the passed type.
| |||||||||||
List< SRelation > | getRelations (Class<?> clazz) | ||||||||||
Returns all relations of the passed class.
| |||||||||||
List< SNode > | getNodes (SALT_TYPE type) | ||||||||||
Returns all nodes of the passed type.
| |||||||||||
List< SNode > | getNodes (Class<?> clazz) | ||||||||||
Returns all nodes of the passed class.
| |||||||||||
List< STextualRelation > | getTextualRelations () | ||||||||||
Returns all relations which connects a token with a primary text contained in this document structure.
| |||||||||||
List< SToken > | getTokens () | ||||||||||
Returns all tokens contained contained in this document structure.
| |||||||||||
STimeline | getTimeline () | ||||||||||
Returns the timeline of this document graph.A timeline is a specific datasource and acts as an anchor for STimelineRelations. A timeline is necessary to set tokens in correspondance when they belong to different STextualDSs. For instance a timeline is necessary to model dialogue data.
| |||||||||||
void | setTimeline (STimeline value) | ||||||||||
Sets a new timeline- A timeline is a specific datasource and acts as an anchor for STimelineRelations.A timeline is necessary to set tokens in correspondance when they belong to different STextualDSs. For instance a timeline is necessary to model dialogue data.
| |||||||||||
List< STimelineRelation > | getTimelineRelations () | ||||||||||
List< SSpanningRelation > | getSpanningRelations () | ||||||||||
List< SSpan > | getSpans () | ||||||||||
List< SStructure > | getStructures () | ||||||||||
List< SDominanceRelation > | getDominanceRelations () | ||||||||||
List< SPointingRelation > | getPointingRelations () | ||||||||||
List< SMedialRelation > | getMedialRelations () | ||||||||||
List< SMedialDS > | getMedialDSs () | ||||||||||
List< SOrderRelation > | getOrderRelations () | ||||||||||
SRelation | addNode (SNode source, SNode target, SALT_TYPE sRelationType) | ||||||||||
Creates and returns a 'SRelation' of the type given by sRelationType between source and target.Note that the source is required to be in the SDocumentGraph already and that the elationType may only be one of SALT_TYPE#STEXTUAL_RELATION, SALT_TYPE#SSPANNING_RELATION, SALT_TYPE#SDOMINANCE_RELATION and SALT_TYPE#SPOINTING_RELATION.
| |||||||||||
STextualDS | createTextualDS (String text) | ||||||||||
Creates and adds a new STextualDS node object and sets its text to the passed one and adds it to the graph.
| |||||||||||
SToken | createToken (List< DataSourceSequence > sequences) | ||||||||||
Creates a new SToken object and adds it to the graph.The SToken object will be connected with the SSequentialDS object given in the passed DataSourceSequence object. The created relations get the borders also given in the DataSourceSequence object.
| |||||||||||
SToken | createToken (SSequentialDS sequentialDS, Integer start, Integer end) | ||||||||||
Creates a new SToken object and adds it to the graph.The SToken object will be connected with the given SSequentialDS object. The created relation get the passed positions.
| |||||||||||
SToken | createToken (DataSourceSequence sDSSequence) | ||||||||||
Creates a new SToken object and adds it to the graph.The SToken object will be connected with the SSequentialDS objects given in the passed DataSourceSequence object. The created relations get the borders also given in the DataSourceSequence object.
| |||||||||||
SSpan | createSpan (List< SToken > tokens) | ||||||||||
Creates a SSpan object, adds it to the graph and returns the new object.Further, this method creates SSpanningRelation relations and sets their source to the created SSpan object and the targets to the given source nodes.
| |||||||||||
SSpan | createSpan (SToken... tokens) | ||||||||||
Creates a new SSpan object, adds it to the graph and returns the new object.Further, this method creates a SSpanningRelation object and sets its source to the created SSpan object and the target to the given source node.
| |||||||||||
SStructure | createStructure (List< SStructuredNode > sourceNodes) | ||||||||||
Creates a new SStructure object, adds it to the graph and returns the new object.Further, this method creates SDominanceRelation relations and sets their sources to the created SStructure object and the targets to the given source nodes.
| |||||||||||
SStructure | createStructure (SStructuredNode... structures) | ||||||||||
Creates a new SStructure object, adds it to the graph and returns the new object.Further, this method creates a SDominanceRelation object and sets its source to the created SStructure object and the target to the given source node.
| |||||||||||
STimeline | createTimeline () | ||||||||||
Creates an STimeline object being contained in this SDocumentGraph object.The new STimeline object is filled with points of time computed out of the STextualRelation objects being contained by this SDocumentGraph object. For each STextualDS object, for each STextualRelation object one point of time would be created. If this object already contains a not empty STimeline object the already existing one would be returned.
| |||||||||||
STimelineRelation | createTimelineRelation (SToken token, int timeSteps) | ||||||||||
Creates a STimelineRelation object being contained in this SDocumentGraph object, and attaches the SToken parameter to the document graph's timeline at the end, its start being the current end of the timeline, its end being the current end of the timeline + the time steps passed in as the second parameter.
| |||||||||||
List< SToken > | getTokensBySequence (DataSourceSequence sequence) | ||||||||||
Returns all SToken objects which refer to the passed DataSourceSequence object.The passed object determines the borders of the sequence by the values sStart and sEnd and the type of data source by the instance sSequentialDS.
| |||||||||||
List< SSpan > | getSpansBySequence (DataSourceSequence sequence) | ||||||||||
Returns all SSpan objects which refer to the passed DataSourceSequence object.The passed object determines the borders of the sequence by the values sStart and sEnd and the type of data source by the instance sSequentialDS.
| |||||||||||
List< SStructure > | getStructuresBySequence (DataSourceSequence sequence) | ||||||||||
Returns all SStructure objects which refer to the passed DataSourceSequence object.The passed object determines the borders of the sequence by the values sStart and sEnd and the type of datasource by the instance sSequentialDS.
| |||||||||||
List< SNode > | getNodesBySequence (DataSourceSequence sequence) | ||||||||||
Returns all SNode objects which refer to the passed DataSourceSequence object.The passed object determines the borders of the sequence by the values sStart and sEnd and the type of data source by the instance sSequentialDS.
| |||||||||||
List< DataSourceSequence > | getOverlappedDataSourceSequence (SNode node, SALT_TYPE... relationTypes) | ||||||||||
Returns the sequences as DataSourceSequence which are overlapped by the given SNode node.Overlapped means, that starting from the given SNode node the SSequentialDS can reached by traversing relations of one of the types contained in the given list of SALT_TYPE.
| |||||||||||
List< DataSourceSequence > | getOverlappedDataSourceSequence (List< SNode > nodes, SALT_TYPE... relationTypes) | ||||||||||
Returns the sequences as DataSourceSequence which are overlapped by the given SNode node.Overlapped means, that starting from the given SNode node the SSequentialDS can reached by traversing relations of one of the types contained in the given list of SALT_TYPE.
| |||||||||||
boolean | isContinuousByText (List< SNode > subNodeList, List< SNode > fullNodeList) | ||||||||||
Returns true, if the given list of nodes subNodeList is continuous respecting the overlapped text.A list of nodes is continuous, if there is no other node overlapping a text sequence, which is a subsequence of the sequence overlapped by the given list and is not part of the list.
| |||||||||||
boolean | isContinuousByText (List< SNode > subNodeList) | ||||||||||
Returns true, if the given list of nodes subNodeList is continuous respecting the overlapped text.A list of nodes is continuous, if there is no other node overlapping a text sequence, which is a subsequence of the sequence overlapped by the given list and is not part of the list. The fullSNodeList is given by the token list of this graph.
| |||||||||||
List< SToken > | getSortedTokenByText (List< SToken > tokens2sort) | ||||||||||
Returns all SToken objects being contained in the given list and sorts them by the STextualRelation#getStart() value of SToken object.
| |||||||||||
List< SToken > | getSortedTokenByText () | ||||||||||
Returns all SToken objects being contained in the list SDocumentGraph#getTokens() and sorts them by the STextualRelation#getStart() value of SToken object.
| |||||||||||
void | sortTokenByText () | ||||||||||
Sorts all SToken and STextualRelation objects being contained in the list SDocumentGraph#getTokens() and SDocumentGraph#getSTextualRelations() by the STextualRelation#getStart() value of SToken and STextualRelation object. | |||||||||||
List< SNode > | getRootsByRelation (SALT_TYPE... type) | ||||||||||
Returns all SNode objects which are roots for the given types of SRelation.Means, that all SNodes will be returned as roots, which have no incoming relations of the given type. For instance imagine the following structure and assume that the passed SALT_TYPEs are SALT_TYPE#SDOMINANCE_RELATION and SALT_TYPE#SSPANNING_RELATION:struct1 // || span1 || span2 / \ || | tok1 tok2 tok3 tok4the nodes:struct1 and span2 are returned, even if a pointing relation connects struct1 and span2.
| |||||||||||
Multimap< String, SNode > | getRootsByRelationType (SALT_TYPE type) | ||||||||||
Returns all nodes, which are roots for the given relation-class respects to the given SType of the traversed relation.The following example shows the different to the method getRootsBySRelation(): Imagine the following graphFor example:node1 ->t1 node2, node2 ->t2-> node3Also imagine, that -> is a relation of same class with sType=t1 respectivly sType=t2 The returned roots will be node1 and node 2, because of node1 is the root of a subgraph for relation.sType=t1 and node2 is the root of the subgraph for relation.sType=t2. Whereas the returned nodes of getRootsByRelation(SALT_TYPE) is only node1. All relations having no type are stored in returned map corresponding to key SaltUtil#SALT_NULL_VALUE.
| |||||||||||
List< SToken > | tokenize () | ||||||||||
Tokenizes all STextualDS object being contained in this SDocumentGraph object.The Tokenization is similar to the tokenization made by the TreeTagger tokenizer. This method calls the method createTokenizer() and initializes with automatic detected values. The language will be detected automatically for each STextualDS object by use of the TextCategorizer (see: http://textcat.sourceforge.net/doc/org/knallgrau/utils/textcat/ TextCategorizer.html). If the language is one of the given ones: English, French, Italian and German, abbreviations also taken from the Treetagger will be used. To customize these settings use the method createTokenizer().The used Treetagger is a reimplementation in Java with permission from the original TreeTagger tokenizer in Perl by Helmut Schmid (see: http://www.ims.uni-stuttgart.de/projekte/corplex/TreeTagger/). For each token detected in the text given by sTextualDS.getSText() an SToken object is created and linked with the STextualDS object via a new STextualRelation object containing the textual offset.
| |||||||||||
Tokenizer | createTokenizer () | ||||||||||
Creates a new Tokenizer object to tokenize the set STextualDS objects being contained in this SDocumentGraph object.To customize the tokenization, set take a look to the properties of the returned Tokenizer object. This method is used by the method tokenize(). The used Treetagger is a reimplementation in Java with permission from the original TreeTagger tokenizer in Perl by Helmut Schmid (see: http://www.ims.uni-stuttgart.de/projekte/corplex/TreeTagger/). For each token detected in the text given by sTextualDS.getSText() an SToken object is created and linked with the STextualDS object via a new STextualRelation object containing the textual offset. If the set STextualDS object is empty or if it does not belong to this SDocumentGraph object an exception is thrown.
| |||||||||||
SToken | insertTokenAt (STextualDS sTextualDS, Integer posInText, String text, Boolean insertSpace) | ||||||||||
Inserts a token to the graph starting at position posInText and relates them to the given STextualDS object. An example: Imagine the following sText and tokenization tok1 tok2 tok3 tok4 This is a text.the call insertSTokensAt(sTextualDS, 5, "additional", true); results in tok1 tok5 tok2 tok3 tok4 This additional is a text.
| |||||||||||
List< SToken > | insertTokensAt (STextualDS sTextualDS, Integer posInText, List< String > texts, Boolean insertSpace) | ||||||||||
Inserts n tokens (where n is the size of the given list texts) to the graph starting at position posInText and relates them to the given STextualDS object. An example: Imagine the following sText and tokenization tok1 tok2 tok3 tok4 This is a text.the call insertSTokensAt(sTextualDS, 5, {"additional" "text"}, true); results in tok1 tok5 tok6 tok2 tok3 tok4 This additional text is a text.
| |||||||||||
SRelation | createRelation (SNode sSource, SNode sTarget, SALT_TYPE sRelationType, String sAnnotations) | ||||||||||
Creates a SRelation object, and sets its sSource and sTarget to the passed ones.The created SRelation is of the passed type. If annotations are not empty, even SAnnotation objects will be created. The syntax to pass annotations is: (SNS::)?SNAME(=SVALUE)?(;SNS::SNAME=SVALUE)+ where SNS is the namespace of the annotation, SNAME is its name and SVALUE is the value of the annotation.
| |||||||||||
List< SToken > | getOverlappedTokens (SNode overlappingNode) | ||||||||||
Returns all tokens in the graph, which are overlapped by the passed node and are reachable via SALT_TYPE#STEXT_OVERLAPPING_RELATION having at least one of the passed types.
| |||||||||||
List< SToken > | getOverlappedTokens (SNode overlappingNode, SALT_TYPE... relationTypes) | ||||||||||
Returns all tokens in the graph, which are overlapped by the passed node and are reachable via relations having at least one of the passed types.
| |||||||||||
String | getText (SNode sNode) | ||||||||||
This method returns the exact text overlapped in the STextualDS by the given SNode.Imagine the following graph:n1 / \ t1 t2 t3 t4 t5 | | | | | This is a sample text.The method will return the text 'text' for token t5 and 'is a' for node n1.
| |||||||||||
boolean | isIsomorph (SDocumentGraph other) | ||||||||||
{@inheritDoc SDocumentGraph::isIsomorph(SDocumentGraph)} | |||||||||||
boolean | isIsomorph (SDocumentGraph other, DiffOptions options) | ||||||||||
{@inheritDoc SDocumentGraph::isIsomorph(SDocumentGraph, DiffOptions)} | |||||||||||
Set< Difference > | findDiffs (SDocumentGraph other) | ||||||||||
{@inheritDoc SDocumentGraph::findDiffs()} | |||||||||||
Set< Difference > | findDiffs (SDocumentGraph other, DiffOptions options) | ||||||||||
{@inheritDoc SDocumentGraph::findDiffs(SDocumentGraph, DiffOptions)} | |||||||||||
String | toString () | ||||||||||
Public Member Functions inherited from org.corpus_tools.salt.core.impl.SGraphImpl | |||||||||||
SGraphImpl () | |||||||||||
Initializes an object of type SGraphImpl. | |||||||||||
SGraphImpl (Graph delegate) | |||||||||||
Initializes an object of type SGraphImpl. More... | |||||||||||
void | addLayer (SLayer layer) | ||||||||||
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< SLayer > | getLayerByName (String layerName) | ||||||||||
Searches for a layer or a set of layers having the given layer name.
| |||||||||||
List< SNode > | getRoots () | ||||||||||
Returns all root nodes, if exist.A root node is a node, which has no incoming relations.
| |||||||||||
List< SNode > | getLeafs () | ||||||||||
Returns all leaf nodes, if exist.A leaf node is a node, which has no outgoing relations.
| |||||||||||
List< SNode > | getChildren (SNode parent, SALT_TYPE relationType) | ||||||||||
Returns a list of nodes in base document.The returned nodes are equivalents to the direct children of the passed parent node. The children are retrieved via traversing of relations of the passed SALT_TYPE.
| |||||||||||
List< SNode > | getSharedParent (List< SNode > children, SALT_TYPE nodeType) | ||||||||||
Returns a list of nodes that are the parents of every node in the given base list.Only nodes with the given SALT_TYPE will be considered.
| |||||||||||
void | traverse (List< SNode > startNodes, GRAPH_TRAVERSE_TYPE traverseType, String traverseId, GraphTraverseHandler traverseHandler) | ||||||||||
Traverses a graph in the given order traverseType and starts traversing with the given startNodes.When a node is reached, first this method will invoke the method 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.
| |||||||||||
void | traverse (List<? extends SNode > startNodes, GRAPH_TRAVERSE_TYPE traverseType, String traverseId, GraphTraverseHandler traverseHandler, boolean isCycleSafe) | ||||||||||
Traverses a graph in the given order traverseType and starts traversing with the given startNodes.When a node is reached, first this method will invoke the method 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.
| |||||||||||
void | removeLabel (String qName) | ||||||||||
{@inheritDoc LabelableElement::removeLabel(String)} In case the passed qualified name is equal to SaltUtil#LABEL_ID_QNAME the internal reference to identifier is set to null. In case the passed qualified name is equal to SaltUtil#LABEL_ID_QNAME the internal reference to identifier is set to null. | |||||||||||
String | getName () | ||||||||||
Returns the name of this element.The name of the element is not the identifier of the element. The identifier is given by the graph and constructed as a URI, where the name is used as fragment. If this is not unique, the graph will add a number to the fragment to make it unique.
| |||||||||||
void | setName (String name) | ||||||||||
Sets the name of the element.The name of the element is not the identifier of the element. The identifier is given by the graph and constructed as a URI, where the name is used as fragment. If this is not unique, the graph will add a number to the fragment to make it unique.
| |||||||||||
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.The syntax for Annotations is: (SNS::)?SNAME(=SVALUE)?(;SNS::SNAME=SVALUE)+ where SNS is the namespace of the annotation, SNAME is its name and SVALUE is the value of the annotation
| |||||||||||
void | addAnnotation (SAnnotation annotation) | ||||||||||
Adds the passed annotation to this container.
| |||||||||||
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.
| |||||||||||
Iterator< SAnnotation > | iterator_SAnnotation () | ||||||||||
Returns an iterator to iterate over the SAnnotation objects contained by this container.Using an iterator is slightly faster than getAnnotations().
| |||||||||||
void | addMetaAnnotation (SMetaAnnotation metaAnnotation) | ||||||||||
Adds the passed meta annotation to this container.
| |||||||||||
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.The syntax for meta annotations is: (SNS::)?SNAME(=SVALUE)?(;SNS::SNAME=SVALUE)+ where SNS is the namespace of the meta annotation, SNAME is its name and SVALUE is the value of the meta annotation
| |||||||||||
SMetaAnnotation | getMetaAnnotation (String qName) | ||||||||||
Returns a meta annotation having the passed qualified name, if this container contains such a meta annotation. More... | |||||||||||
Iterator< SMetaAnnotation > | iterator_SMetaAnnotation () | ||||||||||
Returns an iterator to iterate over the SMetaAnnotation objects contained by this container. More... | |||||||||||
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.The syntax for processing-annotations is: (SNS::)?SNAME(=SVALUE)?(;SNS::SNAME=SVALUE)+ where SNS is the namespace of the processing-annotation, SNAME is its name and SVALUE is the value of the processing-annotation
| |||||||||||
void | addProcessingAnnotation (SProcessingAnnotation annotation) | ||||||||||
Adds the passed processing-annotation to this container.
| |||||||||||
SProcessingAnnotation | getProcessingAnnotation (String qName) | ||||||||||
Returns a processing-annotation having the passed qualified name, if this container contains such a processing-annotation.
| |||||||||||
Iterator< SProcessingAnnotation > | iterator_SProcessingAnnotation () | ||||||||||
Returns an iterator to iterate over the SProcessingAnnotation objects contained by this container.Using an iterator is slightly faster than getProcessingAnnotations().
| |||||||||||
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.The syntax for Features is: (SNS::)?SNAME(=SVALUE)?(;SNS::SNAME=SVALUE)+ where SNS is the namespace of the feature, SNAME is its name and SVALUE is the value of the feature
| |||||||||||
void | addFeature (SFeature feature) | ||||||||||
Adds the passed feature to this container.
| |||||||||||
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.
| |||||||||||
Iterator< SFeature > | iterator_SFeature () | ||||||||||
Returns an iterator to iterate over the SFeature objects contained by this container.Using an iterator is slightly faster than getFeatures().
| |||||||||||
URI | getPath () | ||||||||||
Returns the id of this object as a URI path If no Id exists, null is returned.
| |||||||||||
Public Member Functions inherited from org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R > | |||||||||||
GraphImpl (Graph< N, R, L > delegate) | |||||||||||
Initializes an object of type Graph. More... | |||||||||||
IndexMgr | getIndexMgr () | ||||||||||
Returns the index manager. More... | |||||||||||
GraphImpl (int expectedNodes, int expectedRelations) | |||||||||||
Instantiates a new graph object and sets the initial capacity for all indexes to the passed ones. More... | |||||||||||
List< N > | getNodes () | ||||||||||
{@inheritDoc Graph::getNodes()} | |||||||||||
N | getNode (String nodeId) | ||||||||||
{@inheritDoc Graph::getNode(String)} | |||||||||||
void | addNode (N node) | ||||||||||
{@inheritDoc Graph::addNode(Node)} | |||||||||||
void | removeNode (N node) | ||||||||||
{@inheritDoc Graph::removeNode(Node)} | |||||||||||
boolean | containsNode (String nodeId) | ||||||||||
{@inheritDoc Graph::containsNode(String)} | |||||||||||
List< R > | getRelations () | ||||||||||
{@inheritDoc Graph::getRelations()} | |||||||||||
R | getRelation (String relationId) | ||||||||||
{@inheritDoc Graph::getRelation(String)} | |||||||||||
List< R > | getRelations (String sourceNodeId, String targetNodeId) | ||||||||||
Returns all relations,which connects the two passed nodes.
| |||||||||||
List< R > | getInRelations (String nodeId) | ||||||||||
Returns all relations, which have the node corresponding to the passed id as their target node.
| |||||||||||
List< R > | getOutRelations (String nodeId) | ||||||||||
Returns all relations, which have the node corresponding to the passed id as their source node.
| |||||||||||
void | addRelation (Relation<? extends N, ? extends N > relation) | ||||||||||
{@inheritDoc Graph::addRelation(Relation)} | |||||||||||
void | removeRelation (Relation<? extends N, ? extends N > rel) | ||||||||||
Removes the passed relation from this graph.If a relation is removed, it will be deleted from all indexes. If the passed relation is null, nothing is removed.
| |||||||||||
void | removeRelations () | ||||||||||
Removes all relations from this graph and cleans all indexes. | |||||||||||
boolean | containsRelation (String relationId) | ||||||||||
{@inheritDoc Graph::containsRelation(String)} | |||||||||||
Set< L > | getLayers () | ||||||||||
Returns a set of layers contained by this graph.
| |||||||||||
L | getLayer (String layerId) | ||||||||||
Returns a layer corresponding to the passed id, if such a layer is contained in the graph.
| |||||||||||
boolean | containsLayer (String layerId) | ||||||||||
{@inheritDoc Graph::containsLayer(String)} | |||||||||||
void | addLayer (L layer) | ||||||||||
Adds the passed layer to this graph.If layer is null or layer is already contained nothing is inserted. The passed layer and this graph will be double chained, which means the method 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.
| |||||||||||
void | removeLayer (L layer) | ||||||||||
Removes the passed layer from this graph and cleans all indexes.It also ensures, that the graph is removed from the layer, thus invoking 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.
| |||||||||||
Public Member Functions inherited from org.corpus_tools.salt.graph.impl.IdentifiableElementImpl | |||||||||||
IdentifiableElementImpl (IdentifiableElement delegate) | |||||||||||
Identifier | getIdentifier () | ||||||||||
{@inheritDoc IdentifiableElement::getIdentifier()} | |||||||||||
void | setIdentifier (Identifier identifier) | ||||||||||
{@inheritDoc IdentifiableElement::setIdentifier(Identifier)} | |||||||||||
String | getId () | ||||||||||
{@inheritDoc IdentifiableElement::getId()} | |||||||||||
void | setId (String id) | ||||||||||
{@inheritDoc IdentifiableElement::setId(String)} | |||||||||||
Public Member Functions inherited from org.corpus_tools.salt.graph.impl.LabelableElementImpl | |||||||||||
LabelableElementImpl (LabelableElement delegatee) | |||||||||||
Initializes a new object and sets an internal delegate. More... | |||||||||||
Collection< Label > | getLabels () | ||||||||||
{@inheritDoc LabelableElement::getLabels()} | |||||||||||
Label | getLabel (String qName) | ||||||||||
{@inheritDoc LabelableElement::getLabel(String)} | |||||||||||
Label | getLabel (String namespace, String name) | ||||||||||
{@inheritedDoc LabelableElement::getLabel(String, String)} | |||||||||||
Set< Label > | getLabelsByNamespace (String namespace) | ||||||||||
{@inheritDoc LabelableElement::getLabelsByNamespace(String)} | |||||||||||
void | addLabel (Label label) | ||||||||||
Adds the given Label object to the list of labels.
| |||||||||||
void | basicAddLabel (Label label) | ||||||||||
This is an internally used method. More... | |||||||||||
void | basicRemoveLabel (String qName) | ||||||||||
This is an internally used method. More... | |||||||||||
void | removeLabel (String namespace, String name) | ||||||||||
{@inheritDoc LabelableElement::removeLabel(String, String))} | |||||||||||
void | removeAll () | ||||||||||
{@inheritDoc LabelableElement::removeAll()} | |||||||||||
boolean | containsLabel (String qName) | ||||||||||
{@inheritDoc LabelableElement::containsLabel(String)} | |||||||||||
Integer | sizeLabels () | ||||||||||
{@inheritDoc LabelableElement::sizeLabels()} | |||||||||||
Protected Member Functions | |
void | init () |
Calls the init of super class and expands its initialization for adding SaltUtil#IDX_NODETYPE of indexes: More... | |
Protected Member Functions inherited from org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R > | |
Graph< N, R, L > | 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.
| |
void | basicAddNode (N node) |
This is an internally used method. More... | |
void | basicRemoveNode (N node) |
This is an internally used method. More... | |
void | basicAddRelation (Relation<? extends Node, ? extends Node > relation) |
This is an internally used method. More... | |
void | update (Object oldValue, Object container, UPDATE_TYPE updateType) throws SaltException |
Updates all graph internal indexes, concerning the kind of the update which has been made. More... | |
void | basicRemoveRelation (Relation<? extends N, ? extends N > rel) |
This is an internally used method. More... | |
void | basicAddLayer (L layer) |
This is an internally used method. More... | |
void | basicRemoveLayer (L layer) |
This is an internally used method. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from org.corpus_tools.salt.graph.impl.LabelableElementImpl | |
static final int | EXPECTED_NUMBER_OF_LABELS = 5 |
Determines the expected number of labels. | |
Protected Attributes inherited from org.corpus_tools.salt.core.impl.SGraphImpl | |
SFeature | name = null |
The feature object containing the name of the node. | |
Protected Attributes inherited from org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R > | |
IndexMgr | indexMgr = null |
Index manager. | |
int | expectedNodes = 16 |
Number of expected nodes to initialize indexes. | |
int | expectedRelations = 16 |
Number of expected relations to initialize indexes. | |
int | approximatedNodeDegree = expectedRelations / expectedNodes |
Approximated node degree, which is expectedRelations / expectedNodes. | |
Protected Attributes inherited from org.corpus_tools.salt.graph.impl.LabelableElementImpl | |
LabelableElement | delegate = null |
A delegate object of the same type. More... | |
org.corpus_tools.salt.common.impl.SDocumentGraphImpl.SDocumentGraphImpl | ( | Graph | delegate | ) |
Initializes an object of type SDocumentGraphImpl.
If delegate is not null, all functions of this method are delegated to the delegate object. Setting delegate makes this object to a container.
a | delegate object of the same type. |
void org.corpus_tools.salt.common.impl.SDocumentGraphImpl.basic_setDocument | ( | SDocument | document | ) |
This is an internally used method.
To implement a double chaining of SDocument and SDocumentGraph object when a document is set to avoid an endless invocation. The invocation of methods is implement as follows:
setDocument(SDocument) SDocument#setDocumentGraph(Graph) || \ / || || X || \/ / \ \/ basicDocument(SDocument) SDocument#basicSetDocumentGraph(Graph)
document | the container document of this document graph |
|
protected |
Calls the init of super class and expands its initialization for adding SaltUtil#IDX_NODETYPE of indexes:
Reimplemented from org.corpus_tools.salt.graph.impl.GraphImpl< N extends Node, R extends Relation< N, N, L extends Layer< N, R >.