public final class ProductNodeList<T extends ProductNode> extends Object
ProductNode
.Constructor and Description |
---|
ProductNodeList()
Constructs a new list named nodes.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
T node)
Inserts a new node to this list at the given index.
|
boolean |
add(T node)
Adds a new node to this list.
|
void |
clearRemovedList()
Clears the internal removed product nodes list.
|
boolean |
contains(String name)
Tests if this list contains a node with the given name.
|
boolean |
contains(T node)
Tests if this list contains the given node.
|
void |
copyInto(T[] array)
Copies the product nodes of this product node list into the specified array.
|
ProductNodeList<T> |
createSubset(ProductNodeFilter<T> filter)
Creates a subset of this list using the given filter.
|
void |
dispose()
Releases all of the resources used by this object instance and all of its owned children.
|
T |
get(String name)
Gets the element with the given name.
|
T |
getAt(int index) |
T |
getByDisplayName(String displayName)
Gets the element with the given display name.
|
String[] |
getDisplayNames()
Gets the display names of all nodes contained in this list.
|
String[] |
getNames()
Gets the names of all nodes contained in this list.
|
Collection<T> |
getRemovedNodes()
Gets all removed product nodes.
|
int |
indexOf(String name)
Gets the index of the node with the given name.
|
int |
indexOf(T node)
Gets the index of the given node.
|
boolean |
remove(T node)
Removes the given node from this list.
|
void |
removeAll()
Removes all nodes from this list.
|
int |
size() |
ProductNode[] |
toArray()
Returns the list of named nodes as an array.
|
T[] |
toArray(T[] array)
Returns the list of named nodes as an array.
|
public final int size()
public final T getAt(int index)
index
- the index, must be in the range zero to size()
public final String[] getNames()
null
public String[] getDisplayNames()
null
ProductNode.getDisplayName()
public final T get(String name)
name
- the name of the node, must not be null
null
if a node with the given name is not contained in this
listIllegalArgumentException
- if the name is null
public T getByDisplayName(String displayName)
displayName
- the display name of the node, must not be null
null
if a node with the given display name is not contained in this
listIllegalArgumentException
- if the display name is null
ProductNode.getDisplayName()
public final boolean contains(String name)
name
- the name of the node, must not be null
IllegalArgumentException
- if the name is null
public final boolean contains(T node)
node
- the nodeIllegalArgumentException
- if the node is null
public final boolean add(T node)
null
nodes are not added to this list.node
- the node to be added, ignored if null
public final void add(int index, T node)
null
nodes are not added to this
list.node
- the node to be added, ignored if null
index
- the insert indexArrayIndexOutOfBoundsException
- if the index was invalid.public void clearRemovedList()
public Collection<T> getRemovedNodes()
public final boolean remove(T node)
node
- the node to be removed, ignored if null
true
if the node is a member of this list and could successfully be removed,
false
otherwisepublic final void removeAll()
public final void dispose()
This method should be called only if it is for sure that this object instance will never be used again. The
results of referencing an instance of this class after a call to dispose()
are undefined.
public ProductNodeList<T> createSubset(ProductNodeFilter<T> filter)
filter
- the product node filter to be used, if null
a clone of this list is createdpublic final ProductNode[] toArray()
null
public final T[] toArray(T[] array)
array
- the array into which the elements of the list are to be stored, if it is big enough; otherwise, a
new array of the same runtime type is allocated for this purpose.null
public final void copyInto(T[] array)
array
- the array into which the product nodes get copied.NullPointerException
- if the given array is null.IndexOutOfBoundsException
- if the given array is to small.public final int indexOf(String name)
name
- the name of the node, must not be null
-1
if a node with the given name is not
contained in this listIllegalArgumentException
- if the name is null
public final int indexOf(T node)
node
- the node to get the index, must not be null
-1
if the node is not contained in this listIllegalArgumentException
- if the node is null
Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.