public abstract class AbstractContextNode extends AbstractNode implements ContextNode
Constructor and Description |
---|
AbstractContextNode(Graph graph,
ContextNode contextNode) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the context node.
|
int |
compareTo(ContextNode other) |
boolean |
containsContextNode(XDIArc contextNodeXDIArc)
Checks if a context node with a given arc exists under this context node.
|
boolean |
containsContextNodes()
Checks if this context node has one or more context nodes.
|
boolean |
containsIncomingRelations()
Checks if this context node has one or more incoming relations.
|
boolean |
containsIncomingRelations(XDIAddress XDIaddress)
Checks if incoming relations with a given arc exist in this context node.
|
boolean |
containsLiteralBoolean(Boolean literalData)
Checks if this context node has a literal with the given data.
|
boolean |
containsLiteralNode()
Checks if this context node has a literal.
|
boolean |
containsLiteralNode(Object literalData)
Checks if this context node has a literal with the given data.
|
boolean |
containsLiteralNumber(Double literalData)
Checks if this context node has a literal with the given data.
|
boolean |
containsLiteralString(String literalData)
Checks if this context node has a literal with the given data.
|
boolean |
containsRelation(XDIAddress XDIaddress,
XDIAddress targetXDIAddress)
Checks if a relation with a given arc and target node address exists in this context node.
|
boolean |
containsRelations()
Checks if this context node has one or more relations.
|
boolean |
containsRelations(XDIAddress XDIaddress)
Checks if relations with a given arc exist in this context node.
|
boolean |
containsStatement(XDIStatement XDIstatement)
Check if a statement exists in this context node.
|
protected void |
delContextNodeDelAllIncomingRelations()
When a context node is deleted, all incoming relations have to be deleted too.
|
protected void |
delContextNodeDelAllInnerRoots()
When a context node is deleted, all inner roots have to be deleted too.
|
protected void |
delContextNodeDelAllRelations()
When a context node is deleted, all relations have to be deleted too.
|
void |
delContextNodes()
Deletes all context nodes from this context node.
|
void |
delete()
Deletes this node.
|
void |
delIncomingRelations()
Deletes the incoming relations of this context node.
|
protected void |
delRelationDelInnerRoot(XDIAddress XDIaddress,
XDIAddress targetXDIAddress)
When a relation is deleted, its inner root has to be deleted too.
|
void |
delRelations()
Deletes all relations from this context node.
|
void |
delRelations(XDIAddress XDIaddress)
Deletes the relations with a given address from this context node.
|
boolean |
equals(Object object) |
long |
getAllContextNodeCount()
Returns the number of all context nodes under this context node.
|
ReadOnlyIterator<ContextNode> |
getAllContextNodes()
Returns all context nodes under this context node.
|
ReadOnlyIterator<Relation> |
getAllIncomingRelations()
Returns all incoming relations of this context node.
|
ReadOnlyIterator<ContextNode> |
getAllLeafContextNodes()
Returns all leaf context nodes under this context node.
|
long |
getAllLiteralCount()
Returns the number of all literals of this context node.
|
ReadOnlyIterator<LiteralNode> |
getAllLiteralNodes()
Returns all literals of this context node.
|
long |
getAllRelationCount()
Returns the number of all relations of this context node.
|
ReadOnlyIterator<Relation> |
getAllRelations()
Returns all relations of this context node.
|
long |
getAllStatementCount()
Returns the number of all statements in this context node.
|
ReadOnlyIterator<Statement> |
getAllStatements()
Gets all statements in this context node.
|
ContextNode |
getContextNode(XDIArc contextNodeXDIArc)
Returns the context node with a given arc.
|
ContextNode |
getContextNode(XDIArc relativeContextNodeXDIAddress,
boolean subgraph)
Returns the context node with a given arc.
|
long |
getContextNodeCount()
Returns the number of context nodes under this context node.
|
ContextNode |
getDeepContextNode(XDIAddress relativeContextNodeXDIAddress) |
ContextNode |
getDeepContextNode(XDIAddress relativeContextNodeXDIAddress,
boolean subgraph) |
LiteralNode |
getDeepLiteralNode(XDIAddress relativeLiteralNodeXDIAddress) |
LiteralNode |
getDeepLiteralNode(XDIAddress relativeLiteralNodeXDIAddress,
boolean subgraph) |
Node |
getDeepNode(XDIAddress relativeNodeXDIAddress) |
Node |
getDeepNode(XDIAddress relativeNodeXDIAddress,
boolean subgraph) |
Relation |
getDeepRelation(XDIAddress relativeContextNodeXDIAddress,
XDIAddress XDIaddress) |
Relation |
getDeepRelation(XDIAddress relativeContextNodeXDIAddress,
XDIAddress XDIaddress,
XDIAddress targetXDIAddress) |
ReadOnlyIterator<Relation> |
getDeepRelations(XDIAddress relativeContextNodeXDIAddress,
XDIAddress XDIaddress) |
Graph |
getGraph()
Get the graph of this node.
|
ReadOnlyIterator<Relation> |
getIncomingRelations()
Returns the incoming relations of this context node.
|
ReadOnlyIterator<Relation> |
getIncomingRelations(XDIAddress XDIaddress)
Returns the incoming relations with a given arc.
|
LiteralNode |
getLiteralBoolean(Boolean literalData)
Returns the literal of this context node.
|
Object |
getLiteralData()
Get the literal data.
|
Boolean |
getLiteralDataBoolean()
Get the literal data boolean.
|
Double |
getLiteralDataNumber()
Get the literal data number.
|
String |
getLiteralDataString()
Get the literal data string.
|
LiteralNode |
getLiteralNode(Object literalData)
Returns the literal of this context node.
|
LiteralNode |
getLiteralNumber(Double literalData)
Returns the literal of this context node.
|
LiteralNode |
getLiteralString(String literalData)
Returns the literal of this context node.
|
Relation |
getRelation(XDIAddress XDIaddress)
Returns a relation at this context node.
|
Relation |
getRelation(XDIAddress XDIaddress,
XDIAddress targetXDIAddress)
Returns a relation at this context node.
|
long |
getRelationCount()
Returns the number of relations of this context node.
|
long |
getRelationCount(XDIAddress XDIaddress)
Returns the number of relations of this context node.
|
ReadOnlyIterator<Relation> |
getRelations(XDIAddress XDIaddress)
Returns relations at this context node.
|
Statement.ContextNodeStatement |
getStatement()
Gets the statement that represents this context node.
|
Statement |
getStatement(XDIStatement statement)
Gets a statement in this context node.
|
int |
hashCode() |
boolean |
isEmpty()
Checks if the context node is empty.
|
boolean |
isLeafContextNode()
Checks if this context node is a leaf context node.
|
boolean |
isRootContextNode()
Checks if this context node is the root context node.
|
protected void |
setContextNodeCheckValid(XDIArc XDIarc)
Checks if a context node can be created.
|
protected void |
setContextNodeSetInnerRoot(XDIArc XDIarc,
ContextNode contextNode)
When a context node is created, check if the inner root subject and predicate have to be created too.
|
ContextNode |
setDeepContextNode(XDIAddress relativeContextNodeXDIAddress) |
LiteralNode |
setDeepLiteralNode(XDIAddress relativeLiteralNodeXDIAddress) |
Node |
setDeepNode(XDIAddress relativeNodeXDIAddress) |
Relation |
setDeepRelation(XDIAddress relativeContextNodeXDIAddress,
XDIAddress XDIaddress,
Node targetNode) |
Relation |
setDeepRelation(XDIAddress relativeContextNodeXDIAddress,
XDIAddress XDIaddress,
XDIAddress targetXDIAddress) |
LiteralNode |
setLiteralBoolean(Boolean literalData)
Creates a new literal and adds it to this context node, or returns an existing literal.
|
protected void |
setLiteralCheckValid(Object literalData)
Checks if a literal can be created.
|
LiteralNode |
setLiteralNumber(Double literalData)
Creates a new literal and adds it to this context node, or returns an existing literal.
|
LiteralNode |
setLiteralString(String literalData)
Creates a new literal and adds it to this context node, or returns an existing literal.
|
Relation |
setRelation(XDIAddress XDIaddress,
XDIAddress targetXDIAddress)
Creates a new relation and adds it to this context node, or returns an existing relation.
|
protected void |
setRelationCheckValid(XDIAddress XDIaddress,
XDIAddress targetXDIAddress)
Checks if a relation can be created.
|
protected Node |
setRelationSetTargetNode(XDIAddress targetXDIAddress)
When a relation is created, check if the target node has to be created too.
|
Statement |
setStatement(XDIStatement statement)
Sets a statement in this context node.
|
String |
toString() |
getContextNode, getContextNode, getXDIAddress
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
delContextNode, delLiteralNode, delRelation, getContextNodes, getLiteralNode, getRelations, setContextNode, setLiteralNode, setRelation
getContextNode, getContextNode, getXDIAddress, getXDIArc
public AbstractContextNode(Graph graph, ContextNode contextNode)
public Graph getGraph()
Node
public boolean isRootContextNode()
ContextNode
isRootContextNode
in interface ContextNode
public boolean isLeafContextNode()
ContextNode
isLeafContextNode
in interface ContextNode
public void delete()
Node
public void clear()
ContextNode
clear
in interface ContextNode
public boolean isEmpty()
ContextNode
isEmpty
in interface ContextNode
public ContextNode getContextNode(XDIArc relativeContextNodeXDIAddress, boolean subgraph)
ContextNode
getContextNode
in interface ContextNode
relativeContextNodeXDIAddress
- The arc of the context node.subgraph
- This is simply a hint to the implementation whether
child context nodes will subsequently be requested. Implementations may
or may not actually use this parameter.public ContextNode getContextNode(XDIArc contextNodeXDIArc)
ContextNode
getContextNode
in interface ContextNode
contextNodeXDIArc
- The arc of the context node.public ReadOnlyIterator<ContextNode> getAllContextNodes()
ContextNode
getAllContextNodes
in interface ContextNode
public ReadOnlyIterator<ContextNode> getAllLeafContextNodes()
ContextNode
getAllLeafContextNodes
in interface ContextNode
public boolean containsContextNode(XDIArc contextNodeXDIArc)
ContextNode
containsContextNode
in interface ContextNode
contextNodeXDIArc
- The arc to look for.public boolean containsContextNodes()
ContextNode
containsContextNodes
in interface ContextNode
public void delContextNodes()
ContextNode
delContextNodes
in interface ContextNode
public long getContextNodeCount()
ContextNode
getContextNodeCount
in interface ContextNode
public long getAllContextNodeCount()
ContextNode
getAllContextNodeCount
in interface ContextNode
public Relation setRelation(XDIAddress XDIaddress, XDIAddress targetXDIAddress)
ContextNode
setRelation
in interface ContextNode
XDIaddress
- The address of the relation.targetXDIAddress
- The target node address of the relation.public Relation getRelation(XDIAddress XDIaddress, XDIAddress targetXDIAddress)
ContextNode
getRelation
in interface ContextNode
XDIaddress
- The address of the relation.targetXDIAddress
- The target node address of the relation.public Relation getRelation(XDIAddress XDIaddress)
ContextNode
getRelation
in interface ContextNode
XDIaddress
- The address of the relation.public ReadOnlyIterator<Relation> getRelations(XDIAddress XDIaddress)
ContextNode
getRelations
in interface ContextNode
XDIaddress
- The address of the relations.public ReadOnlyIterator<Relation> getIncomingRelations(XDIAddress XDIaddress)
ContextNode
getIncomingRelations
in interface ContextNode
XDIaddress
- The address of the relations.public ReadOnlyIterator<Relation> getIncomingRelations()
ContextNode
getIncomingRelations
in interface ContextNode
public ReadOnlyIterator<Relation> getAllRelations()
ContextNode
getAllRelations
in interface ContextNode
public ReadOnlyIterator<Relation> getAllIncomingRelations()
ContextNode
getAllIncomingRelations
in interface ContextNode
public boolean containsRelation(XDIAddress XDIaddress, XDIAddress targetXDIAddress)
ContextNode
containsRelation
in interface ContextNode
XDIaddress
- The address of the relations.targetXDIAddress
- The target node address of the relation.public boolean containsRelations(XDIAddress XDIaddress)
ContextNode
containsRelations
in interface ContextNode
XDIaddress
- The address of the relations.public boolean containsRelations()
ContextNode
containsRelations
in interface ContextNode
public boolean containsIncomingRelations(XDIAddress XDIaddress)
ContextNode
containsIncomingRelations
in interface ContextNode
public boolean containsIncomingRelations()
ContextNode
containsIncomingRelations
in interface ContextNode
public void delRelations(XDIAddress XDIaddress)
ContextNode
delRelations
in interface ContextNode
XDIaddress
- The address of the relations.public void delRelations()
ContextNode
delRelations
in interface ContextNode
public void delIncomingRelations()
ContextNode
delIncomingRelations
in interface ContextNode
public long getRelationCount(XDIAddress XDIaddress)
ContextNode
getRelationCount
in interface ContextNode
XDIaddress
- The address of the relations.public long getRelationCount()
ContextNode
getRelationCount
in interface ContextNode
public long getAllRelationCount()
ContextNode
getAllRelationCount
in interface ContextNode
public LiteralNode setLiteralString(String literalData)
ContextNode
setLiteralString
in interface ContextNode
literalData
- The literal data string associated with the literal.public LiteralNode setLiteralNumber(Double literalData)
ContextNode
setLiteralNumber
in interface ContextNode
literalData
- The literal data number associated with the literal.public LiteralNode setLiteralBoolean(Boolean literalData)
ContextNode
setLiteralBoolean
in interface ContextNode
literalData
- The literal data boolean associated with the literal.public LiteralNode getLiteralNode(Object literalData)
ContextNode
getLiteralNode
in interface ContextNode
literalData
- The literal data associated with the literal.public LiteralNode getLiteralString(String literalData)
ContextNode
getLiteralString
in interface ContextNode
literalData
- The literal data string associated with the literal.public LiteralNode getLiteralNumber(Double literalData)
ContextNode
getLiteralNumber
in interface ContextNode
literalData
- The literal data number associated with the literal.public LiteralNode getLiteralBoolean(Boolean literalData)
ContextNode
getLiteralBoolean
in interface ContextNode
literalData
- The literal data boolean associated with the literal.public Object getLiteralData()
ContextNode
getLiteralData
in interface ContextNode
public String getLiteralDataString()
ContextNode
getLiteralDataString
in interface ContextNode
public Double getLiteralDataNumber()
ContextNode
getLiteralDataNumber
in interface ContextNode
public Boolean getLiteralDataBoolean()
ContextNode
getLiteralDataBoolean
in interface ContextNode
public ReadOnlyIterator<LiteralNode> getAllLiteralNodes()
ContextNode
getAllLiteralNodes
in interface ContextNode
public boolean containsLiteralNode(Object literalData)
ContextNode
containsLiteralNode
in interface ContextNode
literalData
- The literal data associated with the literal.public boolean containsLiteralString(String literalData)
ContextNode
containsLiteralString
in interface ContextNode
literalData
- The literal data string associated with the literal.public boolean containsLiteralNumber(Double literalData)
ContextNode
containsLiteralNumber
in interface ContextNode
literalData
- The literal data number associated with the literal.public boolean containsLiteralBoolean(Boolean literalData)
ContextNode
containsLiteralBoolean
in interface ContextNode
literalData
- The literal data boolean associated with the literal.public boolean containsLiteralNode()
ContextNode
containsLiteralNode
in interface ContextNode
public long getAllLiteralCount()
ContextNode
getAllLiteralCount
in interface ContextNode
public Node setDeepNode(XDIAddress relativeNodeXDIAddress)
setDeepNode
in interface ContextNode
public Node getDeepNode(XDIAddress relativeNodeXDIAddress, boolean subgraph)
getDeepNode
in interface ContextNode
public Node getDeepNode(XDIAddress relativeNodeXDIAddress)
getDeepNode
in interface ContextNode
public ContextNode setDeepContextNode(XDIAddress relativeContextNodeXDIAddress)
setDeepContextNode
in interface ContextNode
public ContextNode getDeepContextNode(XDIAddress relativeContextNodeXDIAddress, boolean subgraph)
getDeepContextNode
in interface ContextNode
public ContextNode getDeepContextNode(XDIAddress relativeContextNodeXDIAddress)
getDeepContextNode
in interface ContextNode
public LiteralNode setDeepLiteralNode(XDIAddress relativeLiteralNodeXDIAddress)
setDeepLiteralNode
in interface ContextNode
public LiteralNode getDeepLiteralNode(XDIAddress relativeLiteralNodeXDIAddress, boolean subgraph)
getDeepLiteralNode
in interface ContextNode
public LiteralNode getDeepLiteralNode(XDIAddress relativeLiteralNodeXDIAddress)
getDeepLiteralNode
in interface ContextNode
public Relation setDeepRelation(XDIAddress relativeContextNodeXDIAddress, XDIAddress XDIaddress, XDIAddress targetXDIAddress)
setDeepRelation
in interface ContextNode
public Relation setDeepRelation(XDIAddress relativeContextNodeXDIAddress, XDIAddress XDIaddress, Node targetNode)
setDeepRelation
in interface ContextNode
public Relation getDeepRelation(XDIAddress relativeContextNodeXDIAddress, XDIAddress XDIaddress, XDIAddress targetXDIAddress)
getDeepRelation
in interface ContextNode
public Relation getDeepRelation(XDIAddress relativeContextNodeXDIAddress, XDIAddress XDIaddress)
getDeepRelation
in interface ContextNode
public ReadOnlyIterator<Relation> getDeepRelations(XDIAddress relativeContextNodeXDIAddress, XDIAddress XDIaddress)
getDeepRelations
in interface ContextNode
public Statement.ContextNodeStatement getStatement()
ContextNode
getStatement
in interface ContextNode
public Statement setStatement(XDIStatement statement)
ContextNode
setStatement
in interface ContextNode
public Statement getStatement(XDIStatement statement)
ContextNode
getStatement
in interface ContextNode
public ReadOnlyIterator<Statement> getAllStatements()
ContextNode
getAllStatements
in interface ContextNode
public boolean containsStatement(XDIStatement XDIstatement)
ContextNode
containsStatement
in interface ContextNode
public long getAllStatementCount()
ContextNode
getAllStatementCount
in interface ContextNode
protected void setContextNodeCheckValid(XDIArc XDIarc) throws Xdi2GraphException
Xdi2GraphException
protected void setRelationCheckValid(XDIAddress XDIaddress, XDIAddress targetXDIAddress) throws Xdi2GraphException
Xdi2GraphException
protected void setLiteralCheckValid(Object literalData) throws Xdi2GraphException
Xdi2GraphException
protected void setContextNodeSetInnerRoot(XDIArc XDIarc, ContextNode contextNode)
protected Node setRelationSetTargetNode(XDIAddress targetXDIAddress)
protected void delContextNodeDelAllInnerRoots()
protected void delContextNodeDelAllRelations()
protected void delContextNodeDelAllIncomingRelations()
protected void delRelationDelInnerRoot(XDIAddress XDIaddress, XDIAddress targetXDIAddress)
public int compareTo(ContextNode other)
compareTo
in interface Comparable<ContextNode>
Copyright © 2017. All rights reserved.