|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.data.trees.data.Node
org.gcube.data.trees.data.InnerNode
org.gcube.data.tr.neo.nodes.PersistentNode
public class PersistentNode
An InnerNode with persistent state.
Persistent nodes load their state on demand, i.e. when access is required. This optimises partial tree traversals, such as those performed to prune the results of read operations or to update trees in place.
Persistent nodes that are created in READ mode, do
not persist state changes. Those that are created in
UPDATE mode do. This side-effect is visible to
clients to the extent that new nodes acquire identifiers. The following
example captures the implications:
PersistentNode node =.. Edge e = .... node.add(e); assertFalse(node.remove(e));
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.gcube.data.trees.data.Node |
|---|
org.gcube.data.trees.data.Node.State |
| Constructor Summary | |
|---|---|
PersistentNode(org.neo4j.graphdb.GraphDatabaseService db,
org.gcube.data.trees.data.InnerNode node)
Creates an instance in BindingMode.ADD that persists an
InnerNode, assigning an identifier to it and its descendants. |
|
PersistentNode(org.neo4j.graphdb.GraphDatabaseService db,
org.neo4j.graphdb.Node dbnode,
BindingMode mode)
Creates an instance over a database node, in a given binding mode. |
|
| Method Summary | |
|---|---|
boolean |
add(org.gcube.data.trees.data.Edge e)
|
Map<QName,String> |
attributes()
|
org.neo4j.graphdb.Node |
dbnode()
Returns the database node that acts as the entry point to the persistent state of this node |
void |
delete()
|
List<org.gcube.data.trees.data.Edge> |
edges()
|
boolean |
equals(Object obj)
|
int |
hashCode()
|
boolean |
remove(org.gcube.data.trees.data.Edge e)
|
String |
removeAttribute(QName name)
|
String |
setAttribute(QName name,
String value)
|
| Methods inherited from class org.gcube.data.trees.data.InnerNode |
|---|
add, add, child, child, child, child, child, child, children, children, children, children, children, children, children, children, clearState, delta, descendant, descendant, descendants, descendants, descendants, descendants, edge, edge, edge, edges, edges, edges, find, find, hasEdge, hasEdge, hasEdge, labels, labels, markAsNew, remove, remove, remove, remove, size, toString, update |
| Methods inherited from class org.gcube.data.trees.data.Node |
|---|
ancestors, ancestorsAndSelf, attribute, attribute, hasAttribute, hasAttribute, id, parent, removeAttribute, setAttribute, setParent, state, state, uri, uri |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PersistentNode(org.neo4j.graphdb.GraphDatabaseService db,
org.gcube.data.trees.data.InnerNode node)
throws IllegalArgumentException
BindingMode.ADD that persists an
InnerNode, assigning an identifier to it and its descendants.
This works as a copy constructor with side-effects in the database. As it clones the node in memory, it also serialises its state in the database.
the - databasenode - the node
IllegalArgumentException - if the input has already an identifier.
public PersistentNode(org.neo4j.graphdb.GraphDatabaseService db,
org.neo4j.graphdb.Node dbnode,
BindingMode mode)
db - the databasedbnode - the database nodemode - the binding mode| Method Detail |
|---|
public org.neo4j.graphdb.Node dbnode()
public Map<QName,String> attributes()
attributes in class org.gcube.data.trees.data.Node
public String setAttribute(QName name,
String value)
setAttribute in class org.gcube.data.trees.data.Nodepublic String removeAttribute(QName name)
removeAttribute in class org.gcube.data.trees.data.Nodepublic List<org.gcube.data.trees.data.Edge> edges()
edges in class org.gcube.data.trees.data.InnerNodepublic boolean add(org.gcube.data.trees.data.Edge e)
add in class org.gcube.data.trees.data.InnerNodepublic boolean remove(org.gcube.data.trees.data.Edge e)
remove in class org.gcube.data.trees.data.InnerNodepublic void delete()
delete in class org.gcube.data.trees.data.InnerNodepublic boolean equals(Object obj)
equals in class org.gcube.data.trees.data.InnerNodepublic int hashCode()
hashCode in class org.gcube.data.trees.data.InnerNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||