public class JArrayNode extends AbstractJNode implements JNode
parent, type
Constructor and Description |
---|
JArrayNode()
Default Constructor for detached node.
|
JArrayNode(JNode fParent)
Constructor for node attached to tree.
|
Modifier and Type | Method and Description |
---|---|
void |
addNode(JNode node)
Add element to composite node (without name).
|
<K,T extends JNode> |
addNode(K idx,
T node)
Add element to composite node.
|
JNode |
clone()
Return copy of this object, detached from node tree.
|
boolean |
equals(java.lang.Object obj) |
java.util.List<JNode> |
getChildren()
Returns set of all children of composite (Object or Array) node.
|
<T> JNode |
getNode(T idx)
Returns child node of this node by selector.
|
int |
hashCode() |
java.util.Iterator<JNode> |
iterator()
Returns iterator over elements of composite node.
|
<K> void |
removeNode(K selector)
Remove child node of this node by selector.
|
<N extends JNode> |
removeNode(N node)
Remove child node of this node.
|
java.lang.String |
toJson()
Return this node as a JSON document.
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String indent,
boolean showPath,
boolean deep)
Return printable (well formatted) text represents this node.
|
fieldNames, getDocRoot, getKey, getParent, getPath, getType, getValue, getValue, setKey, setValue
public JArrayNode()
public JArrayNode(JNode fParent)
fParent
- reference to parent node.public <T> JNode getNode(T idx)
JNode
public <K,T extends JNode> void addNode(K idx, T node)
JNode
public void addNode(JNode node)
JNode
public <K> void removeNode(K selector)
JNode
removeNode
in interface JNode
K
- type of the selector: Integer or String.selector
- is index or key.public <N extends JNode> void removeNode(N node)
JNode
removeNode
in interface JNode
N
- type of nodenode
- to removepublic java.util.Iterator<JNode> iterator()
JNode
iterator
in interface JNode
iterator
in interface java.lang.Iterable<JNode>
iterator
in class AbstractJNode
Iterable
public java.util.List<JNode> getChildren()
JNode
getChildren
in interface JNode
getChildren
in class AbstractJNode
public JNode clone()
JNode
clone
in interface JNode
clone
in class AbstractJNode
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String indent, boolean showPath, boolean deep)
JNode
public java.lang.String toJson()
JNode
public int hashCode()
hashCode
in class AbstractJNode
public boolean equals(java.lang.Object obj)
equals
in class AbstractJNode