Cloneable
Children.Keys
, Children.SortedArray
, Index.ArrayChildren
public static class Children.Array extends Children implements Cloneable
Directly subclassing this class is discouraged.
Children.Keys
is preferable.
Children.Array, Children.Keys<T>, Children.Map<T>, Children.SortedArray, Children.SortedMap<T>
Modifier and Type | Field | Description |
---|---|---|
protected Collection<Node> |
nodes |
vector of added children
|
Modifier | Constructor | Description |
---|---|---|
|
Array() |
Constructs a new array children without any assigned collection.
|
protected |
Array(Collection<Node> c) |
Constructs a new list and allows a subclass to
provide its own implementation of
Collection to store
data in. |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(Node[] arr) |
Add nodes to this container but do not call this method.
|
Object |
clone() |
Clones all nodes that are contained in the children list.
|
protected Collection<Node> |
initCollection() |
Allow subclasses to create a collection, the first time the
children are used.
|
protected void |
refresh() |
This method can be called by subclasses that
directly modify the nodes collection to update the
state of the nodes appropriatelly.
|
boolean |
remove(Node[] arr) |
Remove nodes from the list.
|
addNotify, create, createLazy, findChild, getNode, getNodeAt, getNodes, getNodes, getNodesCount, getNodesCount, isInitialized, nodes, removeNotify, snapshot
protected Collection<Node> nodes
protected Array(Collection<Node> c)
Collection
to store
data in. The collection should be empty and should not
be directly accessed in any way after creation.c
- collection to store data inpublic Array()
public Object clone()
protected Collection<Node> initCollection()
The current implementation returns ArrayList.
protected final void refresh()
public boolean add(Node[] arr)
Children
Children.Keys.setKeys(java.util.Collection<? extends T>)
instead.
The parent node of these nodes
is changed to the parent node of this list. Each node can be added
only once. If there is some reason a node cannot be added, for example
if the node expects only a special type of subnodes, the method should
do nothing and return false
to signal that the addition has not been successful.
This method should be implemented by subclasses to filter some nodes, etc.
Built on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.