Node.State| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
ancestors, ancestorsAndSelf, attribute, attribute, attributes, hasAttribute, hasAttribute, id, parent, removeAttribute, removeAttribute, setAttribute, setAttribute, setParent, state, state, uri, uripublic 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 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.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;
update in class Nodedelta - the delta nodeIllegalStateException - if this node has no identifierIllegalArgumentException - 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 expectedprotected 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.
delta in class Nodef - 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()
Copyright © 2017. All Rights Reserved.