|
||||||||||
| 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.Leaf
public class Leaf
A leaf Node.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.gcube.data.trees.data.Node |
|---|
Node.State |
| Constructor Summary | |
|---|---|
Leaf(Leaf leaf)
Copy constructor, creates an instance as a clone of a given Leaf. |
|
Leaf(String id)
Creates an instance with a given identifier. |
|
Leaf(String v,
Map<QName,String> attributes)
Creates an instance with given attributes and a given value. |
|
Leaf(String id,
Node.State state,
String v,
Map<QName,String> attributes)
Creates an instance with a given identifier, given attributes, and a given value. |
|
Leaf(String id,
String v)
Creates an instance with a given identifier and a given value. |
|
| Method Summary | |
|---|---|
void |
delete()
Marks the node as Node.State.DELETED, removing all its attributes and replacing its value with null. |
protected Leaf |
delta(Node f)
Returns a node that reflects the delta between this node and a given input node. |
boolean |
equals(Object obj)
|
int |
hashCode()
|
long |
size()
Returns the size of the tree rooted in this node, in bytes. |
String |
toString()
|
void |
update(Node delta)
Applies the changes captured by the delta node in input (cf. |
String |
value()
Returns the inner value. |
void |
value(String v)
Sets the inner value. |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Leaf(Leaf leaf)
Leaf.
leaf - the leaf.public Leaf(String id)
id - the identifier.
public Leaf(String id,
String v)
id - the identifier.v - the value.
public Leaf(String v,
Map<QName,String> attributes)
attributes - the attributes.
public Leaf(String id,
Node.State state,
String v,
Map<QName,String> attributes)
id - the identifier.v - the value.attributes - the attributes.| Method Detail |
|---|
public String value()
public void value(String v)
throws IllegalArgumentException
v - the value.
IllegalArgumentExceptionpublic void delete()
Node.State.DELETED, removing all its attributes and replacing its value with null.
delete in class Node
public void update(Node delta)
throws IllegalStateException,
IllegalArgumentException
delta(Node)).
This operation acts as the inverse of delta(Node). In particular:
null;
null value which do no exist in this node;
delta - the delta node
IllegalStateException - if this node has no identifier
IllegalArgumentException - if the delta node is not a leaf, or has an unexpected state,
or its identifier differs form this node's, or more generally its attributes do not relate to those of this
node as expected
protected Leaf delta(Node f)
throws IllegalArgumentException
The delta node can only be computed if the input node has the same identifier as this node.
For all purposes, in fact,
the input node is expected to be (or simply look like) a future version of this node, as
if it was originally cloned from this node and had evolved since.
Under this assumption, the delta node has:
nullvalue;
Node.State.MODIFIED if, based on the rules above, the delta node actually differs from this node.
f - the input node.
IllegalArgumentException - if this node has no identifier or it has a different type or a different identifier than this node.
public long size()
size in class Nodepublic String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Nodepublic int hashCode()
hashCode in class Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||