|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.contentmanagement.contentmanager.stubs.model.trees.Node
org.gcube.contentmanagement.contentmanager.stubs.model.trees.InnerNode
public class InnerNode
A (thread-safe) Node
with an identity and outgoing edges.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.gcube.contentmanagement.contentmanager.stubs.model.trees.Node |
---|
Node.State |
Constructor Summary | |
---|---|
InnerNode()
Creates an instance. |
|
InnerNode(Edge... edges)
Constructs an instance with a given edges. |
|
InnerNode(InnerNode n)
Copy constructor, creates a clone of a given node. |
|
InnerNode(java.lang.String id)
Constructs an instance with a given identifier. |
|
InnerNode(java.lang.String id,
Edge... edges)
Constructs an instance with a given identifier and edges. |
|
InnerNode(java.lang.String id,
java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes,
Edge... edges)
Constructs an instance with a given identifier, attributes, and edges. |
|
InnerNode(java.lang.String id,
Node.State state,
java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes,
Edge... edges)
Constructs an instance with a given identifier, state, attributes, and edges. |
Method Summary | ||
---|---|---|
boolean |
add(Edge... es)
Adds one or more edges. |
|
boolean |
add(java.util.List<Edge> es)
Adds one or more edges. |
|
|
child(java.lang.Class<T> type,
javax.xml.namespace.QName label)
Returns a child of this node with a given label and of a given node type, if exactly one exists. |
|
|
child(java.lang.Class<T> type,
java.lang.String name)
Returns a child of this node with a given label and of a given node type, if exactly one exists. |
|
|
child(java.lang.Class<T> type,
java.lang.String ns,
java.lang.String name)
Returns a child of this node with a given label and of a given type, if exactly one exists. |
|
Node |
child(javax.xml.namespace.QName label)
Returns a child of this node with a given label, if exactly one exists. |
|
Node |
child(java.lang.String name)
Returns a child of this node with a given label, if exactly one exists. |
|
Node |
child(java.lang.String ns,
java.lang.String name)
Returns a child of this node with a given label, if exactly one exists. |
|
java.util.List<Node> |
children()
Returns all the children of this node. |
|
|
children(java.lang.Class<T> type)
Returns all the children of this node of a given node type. |
|
|
children(java.lang.Class<T> type,
javax.xml.namespace.QName label)
Returns all the children of this node with a given label and a given node type. |
|
|
children(java.lang.Class<T> type,
java.lang.String name)
Returns all the children of this node with a given label and a given node type. |
|
|
children(java.lang.Class<T> type,
java.lang.String ns,
java.lang.String name)
Returns all the children of this node with a given label and given node type. |
|
java.util.List<Node> |
children(javax.xml.namespace.QName label)
Returns all the children of this node with a given label. |
|
java.util.List<Node> |
children(java.lang.String name)
Returns all the children of this node with a given label. |
|
java.util.List<Node> |
children(java.lang.String ns,
java.lang.String name)
Returns all the children of this node with a given label. |
|
InnerNode |
delta(Node f)
Returns a node that reflects the delta between this document and a given input node. |
|
|
descendant(java.lang.Class<T> type,
java.lang.String... descendantIDs)
Returns the descendant of this node of a given tree type which can be reached by following a given sequence of node identifiers. |
|
Node |
descendant(java.lang.String... descendantIDs)
Returns the descendant of this node that can be reached by following a given sequence of node identifiers. |
|
|
descendants(java.lang.Class<T> type,
javax.xml.namespace.QName... labels)
Returns all the descendants of a given node type which can be reached by following a given sequence of labels. |
|
|
descendants(java.lang.Class<T> type,
java.lang.String... labels)
Returns all the descendants of a given node type that can be reached by following a given sequence of labels. |
|
java.util.List<Node> |
descendants(javax.xml.namespace.QName... labels)
Returns all the descendants that can be reached by following a given sequence of labels. |
|
java.util.List<Node> |
descendants(java.lang.String... labels)
Returns all the descendants that can be reached by following a given sequence of labels. |
|
Edge |
edge(javax.xml.namespace.QName l)
Returns the edges with a given label, if exactly one exists. |
|
Edge |
edge(java.lang.String l)
Returns the edges with a given label, if exactly one exists. |
|
Edge |
edge(java.lang.String ns,
java.lang.String l)
Returns the edges with a given label, if exactly one exists. |
|
java.util.List<Edge> |
edges()
Returns all the edges. |
|
java.util.List<Edge> |
edges(javax.xml.namespace.QName l)
Returns the outgoing edges with a given label. |
|
java.util.List<Edge> |
edges(java.lang.String l)
Returns the outgoing edges with a given label. |
|
java.util.List<Edge> |
edges(java.lang.String ns,
java.lang.String l)
Returns the outgoing edges with a given label. |
|
boolean |
equals(java.lang.Object obj)
|
|
boolean |
hasEdge(javax.xml.namespace.QName l)
Indicates whether the node has at least an edge with a given label. |
|
boolean |
hasEdge(java.lang.String l)
Indicates whether the node has at least an edge with a given label. |
|
boolean |
hasEdge(java.lang.String ns,
java.lang.String l)
Indicates whether the node has at least an edge with a given label. |
|
int |
hashCode()
|
|
java.util.List<javax.xml.namespace.QName> |
labels()
Returns the labels of all the outgoing edges. |
|
java.util.List<javax.xml.namespace.QName> |
labels(javax.xml.namespace.QName l)
Returns all the labels that match a given one. |
|
static void |
main(java.lang.String[] args)
|
|
boolean |
remove(Edge... es)
Removes one or more edges. |
|
boolean |
remove(java.util.List<Edge> es)
Removes one or more edges. |
|
java.util.List<Node> |
remove(java.lang.String... childIDs)
Removes one or more children. |
|
Node |
remove(java.lang.String childID)
Removes a child. |
|
java.lang.String |
toString()
|
Methods inherited from class org.gcube.contentmanagement.contentmanager.stubs.model.trees.Node |
---|
ancestors, ancestorsAndSelf, attribute, attribute, attribute, attributes, hasAttribute, hasAttribute, hasAttribute, id, parent, removeAttribute, removeAttribute, removeAttribute, setAttribute, setAttribute, setAttribute, state, uri |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InnerNode(InnerNode n)
n
- the node.public InnerNode()
public InnerNode(java.lang.String id)
id
- the identifier.public InnerNode(java.lang.String id, Edge... edges)
id
- the identifier.edges
- the edges.public InnerNode(Edge... edges)
edges
- the edges.public InnerNode(java.lang.String id, java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes, Edge... edges)
id
- the identifier.attributes
- the attributes.edges
- the edges.public InnerNode(java.lang.String id, Node.State state, java.util.Map<javax.xml.namespace.QName,java.lang.String> attributes, Edge... edges)
id
- the identifier.state
- attributes
- the attributes.edges
- the edges.Method Detail |
---|
public java.util.List<Node> children()
public <T extends Node> java.util.List<T> children(java.lang.Class<T> type)
the
- node type.
public java.util.List<Node> children(javax.xml.namespace.QName label)
public <T extends Node> java.util.List<T> children(java.lang.Class<T> type, javax.xml.namespace.QName label)
the
- node type.
public java.util.List<Node> children(java.lang.String name) throws java.lang.IllegalArgumentException
name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.public <T extends Node> java.util.List<T> children(java.lang.Class<T> type, java.lang.String name) throws java.lang.IllegalArgumentException
the
- node type.name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.public java.util.List<Node> children(java.lang.String ns, java.lang.String name) throws java.lang.IllegalArgumentException
ns
- the label's namespace.name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.public <T extends Node> java.util.List<T> children(java.lang.Class<T> type, java.lang.String ns, java.lang.String name) throws java.lang.IllegalArgumentException
the
- node type.ns
- the label's namespace.name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.public Node descendant(java.lang.String... descendantIDs) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
descendantIDs
- the identifiers.
java.lang.IllegalStateException
- if the sequence does not lead to a descendant of this node.
java.lang.IllegalArgumentException
public <T extends Node> T descendant(java.lang.Class<T> type, java.lang.String... descendantIDs) throws java.lang.IllegalStateException
the
- tree type.descendantIDs
- the identifiers.
java.lang.IllegalStateException
- if the sequence does not lead to a descendant of this node of the given type.public java.util.List<Node> descendants(javax.xml.namespace.QName... labels) throws java.lang.IllegalArgumentException
labels
- the labels.
java.lang.IllegalArgumentException
- if no labels are specified.public <T extends Node> java.util.List<T> descendants(java.lang.Class<T> type, javax.xml.namespace.QName... labels) throws java.lang.IllegalArgumentException
the
- node type.labels
- the labels.
java.lang.IllegalArgumentException
- if no labels are specified.public java.util.List<Node> descendants(java.lang.String... labels) throws java.lang.IllegalArgumentException
labels
- the local names of the labels.
java.lang.IllegalArgumentException
- if no labels are specified.public <T extends Node> java.util.List<T> descendants(java.lang.Class<T> type, java.lang.String... labels) throws java.lang.IllegalArgumentException
the
- node type.labels
- the local names of the labels.
java.lang.IllegalArgumentException
- if no labels are specified.public Node child(javax.xml.namespace.QName label) throws java.lang.IllegalStateException
label
- the label.
java.lang.IllegalStateException
- if the node has zero or more than one children with the given label.public <T extends Node> T child(java.lang.Class<T> type, javax.xml.namespace.QName label) throws java.lang.IllegalStateException
type
- the node type.label
- the label.
java.lang.IllegalStateException
- if the node has zero or more than one children with the given label and of
the given type.public Node child(java.lang.String name) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.
java.lang.IllegalStateException
- if the node has zero or more than one children with the given label.public <T extends Node> T child(java.lang.Class<T> type, java.lang.String name) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
the
- node type.name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.
java.lang.IllegalStateException
- if the node has zero or more than one children with the given label
and of the given type.public Node child(java.lang.String ns, java.lang.String name) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
ns
- the label's namespace.name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.
java.lang.IllegalStateException
- if the node has zero or more than one children with the given label.public <T extends Node> T child(java.lang.Class<T> type, java.lang.String ns, java.lang.String name) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
the
- node type.ns
- the label's namespace.name
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.
java.lang.IllegalStateException
- if the node has zero or more than one children with the given label and
of the given type.public java.util.List<Edge> edges()
public java.util.List<Edge> edges(javax.xml.namespace.QName l)
l
- the label.
public java.util.List<Edge> edges(java.lang.String ns, java.lang.String l) throws java.lang.IllegalArgumentException
ns
- the label's namespace.l
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
public java.util.List<Edge> edges(java.lang.String l) throws java.lang.IllegalArgumentException
l
- the label's local name.
java.lang.IllegalArgumentException
- if the label's local name is null
.public boolean hasEdge(javax.xml.namespace.QName l)
l
- the label.
true
if it does, false
otherwise.public boolean hasEdge(java.lang.String l) throws java.lang.IllegalArgumentException
l
- the label's local name.
true
if it does, false
otherwise.
java.lang.IllegalArgumentException
- if the label's local name is null
.public boolean hasEdge(java.lang.String ns, java.lang.String l) throws java.lang.IllegalArgumentException
the
- label's namespace.l
- the label's local name.
true
if it does, false
otherwise.
java.lang.IllegalArgumentException
- if the label's local name is null
.public Edge edge(javax.xml.namespace.QName l) throws java.lang.IllegalStateException
l
- the label.
java.lang.IllegalStateException
- if there no edge or more than one edge with a give label.public Edge edge(java.lang.String l) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
l
- the label's local name.
java.lang.IllegalStateException
- if there no edge or more than one edge with a give label.
java.lang.IllegalArgumentException
- if the label's local name is null
.public Edge edge(java.lang.String ns, java.lang.String l) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
ns
- the label's namespace.l
- the label's local name.
java.lang.IllegalStateException
- if there no edge or more than one edge with a give label.
java.lang.IllegalArgumentException
- if the label's local name is null
.public java.util.List<javax.xml.namespace.QName> labels()
public java.util.List<javax.xml.namespace.QName> labels(javax.xml.namespace.QName l)
l
- the label to match.
public boolean remove(java.util.List<Edge> es)
es
- the edges.
true
if any edge was actually removed, false
otherwise.public boolean remove(Edge... es)
es
- the edges.
true
if any edge was actually removed, false
otherwise.public Node remove(java.lang.String childID) throws java.lang.IllegalStateException
childID
- the child's identifier.
true
if the child was actually removed, false
otherwise.
java.lang.IllegalStateException
- if the child does not exist.public java.util.List<Node> remove(java.lang.String... childIDs)
childIDs
- the children's identifiers.
public boolean add(java.util.List<Edge> es)
es
- the edges.
true
if any edge was actually added, false
otherwise.public boolean add(Edge... es)
es
- the edges.
true
if any edge was actually added, false
otherwise.public InnerNode delta(Node f) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
The delta node is computed under the expectation that the the input node is (or simply looks 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:
Node.NULL
value (node by node);
State#DELETED
, for deleted, and
emptied of their attributes and their own children;
State#NEW
, for new;
State#MODIFIED
, for updated (was it only for a change of value in a leaf node).
State#MODIFIED
if, based on the rules above, the delta node has at least some children or attributes.
future
- the input node.
java.lang.IllegalArgumentException
- in the following circumstances:
java.lang.IllegalStateException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class Node
public int hashCode()
hashCode
in class Node
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |