Node.State| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
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, updateancestors, ancestorsAndSelf, attribute, attribute, attributes, hasAttribute, hasAttribute, id, parent, removeAttribute, removeAttribute, setAttribute, setAttribute, setParent, state, state, uri, uripublic 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 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 treeIllegalArgumentException - in the following circumstances:
public int hashCode()
InnerNodeCopyright © 2018. All Rights Reserved.