|
||||||||||
| 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.trees.data.Tree
public class Tree
An InnerNode at the root of a tree.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.gcube.data.trees.data.Node |
|---|
Node.State |
| Constructor Summary | |
|---|---|
Tree()
Creates an instance. |
|
Tree(Edge... edges)
Constructs an instance with given edges. |
|
Tree(String id)
Constructs an instance with a given identifier. |
|
Tree(String id,
Edge... edges)
Constructs an instance with a given identifier and edges. |
|
Tree(String id,
Map<QName,String> attributes,
Edge... edges)
Constructs an instance with a given identifier, attributes, and edges. |
|
Tree(String id,
Node.State state,
Map<QName,String> attributes,
Edge... edges)
|
|
Tree(String sourceId,
String id,
Edge... edges)
Constructs an instance in a given source with a given identifier and given edges. |
|
Tree(Tree tree)
Copy constructor, creates an instance as a clone of a given tree. |
|
| Method Summary | |
|---|---|
Tree |
delta(Tree future)
Returns a tree that reflects the delta between this tree and a given tree, or null if
the tree are equals. |
boolean |
equals(Object obj)
|
int |
hashCode()
|
void |
setSourceId(String id)
Sets the identifier of the tree source. |
String |
sourceId()
Returns the identifier of the tree source. |
String |
toString()
|
| Methods inherited from class org.gcube.data.trees.data.InnerNode |
|---|
add, add, add, child, child, child, child, child, child, children, children, children, children, children, children, children, children, clearState, delete, delta, descendant, descendant, descendants, descendants, descendants, descendants, edge, edge, edge, edges, edges, edges, edges, find, find, hasEdge, hasEdge, hasEdge, labels, labels, markAsNew, remove, remove, remove, remove, remove, size, update |
| Methods inherited from class org.gcube.data.trees.data.Node |
|---|
ancestors, ancestorsAndSelf, attribute, attribute, attributes, hasAttribute, hasAttribute, id, parent, removeAttribute, removeAttribute, setAttribute, setAttribute, setParent, state, state, uri, uri |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Tree(Tree tree)
tree - the tree.public Tree()
public Tree(String id)
id - the identifier.
public Tree(String id,
Edge... edges)
id - the identifier.edges - the edges.public Tree(Edge... edges)
edges - the edges.
public Tree(String sourceId,
String id,
Edge... edges)
sourceId - the source identifier.id - the identifier.edges - the edges.
public Tree(String id,
Map<QName,String> attributes,
Edge... edges)
id - the identifier.attributes - the attributes.edges - the edges.
public Tree(String id,
Node.State state,
Map<QName,String> attributes,
Edge... edges)
| Method Detail |
|---|
public void setSourceId(String id)
id - the identifierpublic String sourceId()
public Tree delta(Tree future)
throws IllegalArgumentException
null if
the tree are equals.
The delta tree can only be computed if the input tree has the same identifier as this tree, and it is repeated recursively for all pairs of children that verify the same condition. For all purposes, in fact, the input tree is expected to be (or simply look like) a future version of this tree, as if it was originally cloned from this tree and had evolved since.
Under this assumption, the delta tree has:
null value (node by node);
Node.State.DELETED, for deleted, and
emptied of their attributes and their own children;
Node.State.NEW, for new;
future - the input tree
IllegalArgumentException - in the following circumstances:
public String toString()
toString in class InnerNodepublic int hashCode()
InnerNode
hashCode in class InnerNodepublic boolean equals(Object obj)
InnerNode
equals in class InnerNode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||