public class ProductNodeGroup<T extends ProductNode> extends ProductNode
ProductNode
.PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME
Constructor and Description |
---|
ProductNodeGroup(ProductNode owner,
String name,
boolean takingOverNodeOwnership)
Constructs a node group for the given owner.
|
ProductNodeGroup(String name)
Constructs a node group with no owner and which will not take ownership of added children.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(ProductVisitor visitor)
Accepts the given visitor.
|
void |
add(int index,
T node)
Adds the given node to this group.
|
boolean |
add(T node)
Adds the given node to this group.
|
void |
clearRemovedList() |
boolean |
contains(String name)
Tests whether a node with the given name is contained in this group.
|
boolean |
contains(T node)
Tests whether the given product is contained in this list.
|
void |
dispose()
Releases all of the resources used by this object instance and all of its owned children.
|
T |
get(int index) |
T |
get(String name) |
T |
getByDisplayName(String displayName) |
int |
getNodeCount() |
String[] |
getNodeDisplayNames()
Returns the display names of all products currently managed.
|
String[] |
getNodeNames()
Returns the names of all products currently managed.
|
long |
getRawStorageSize(ProductSubsetDef subsetDef)
Gets an estimated, raw storage size in bytes of this product node.
|
Collection<T> |
getRemovedNodes()
Gets all removed node nodes.
|
int |
indexOf(String name) |
int |
indexOf(T element) |
boolean |
isTakingOverNodeOwnership() |
boolean |
remove(T node)
Removes the given node from this group.
|
void |
removeAll()
Removes all nodes from this group.
|
void |
setModified(boolean modified)
Sets this node's modified flag.
|
ProductNode[] |
toArray()
Returns an array of all products currently managed.
|
T[] |
toArray(T[] array) |
void |
updateExpression(String oldExternalName,
String newExternalName)
Asks a product node to replace all occurences of and references to the node name
given by
oldExternalName with oldExternalName . |
fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, setOwner, toString
getExtension
public ProductNodeGroup(String name)
name
- The group name.public ProductNodeGroup(ProductNode owner, String name, boolean takingOverNodeOwnership)
owner
- The owner of the group.name
- The group name.takingOverNodeOwnership
- If true
, child nodes will have this group as owner after adding.public boolean isTakingOverNodeOwnership()
true
, if child nodes will have this group as owner after adding.public int getNodeCount()
public T get(int index)
index
- The node index.public String[] getNodeDisplayNames()
null
, but the array can have zero lengthProductNode.getDisplayName()
public String[] getNodeNames()
null
, but the array can have zero lengthpublic ProductNode[] toArray()
null
, but the array can have zero lengthpublic 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
, but the array can have zero lengthpublic int indexOf(String name)
public int indexOf(T element)
public T getByDisplayName(String displayName)
displayName
- the display namepublic T get(String name)
name
- the namepublic boolean contains(String name)
name
- the namepublic boolean contains(T node)
node
- the nodepublic boolean add(T node)
node
- the node to be added, ignored if null
public void add(int index, T node)
index
- the index.node
- the node to be added, ignored if null
public boolean remove(T node)
node
- the node to be removedpublic void removeAll()
public void clearRemovedList()
public Collection<T> getRemovedNodes()
public long getRawStorageSize(ProductSubsetDef subsetDef)
ProductNode
getRawStorageSize
in class ProductNode
subsetDef
- if not null
the subset may limit the size returnedpublic void setModified(boolean modified)
ProductNode
If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.
setModified
in class ProductNode
modified
- whether or not this node is beeing marked as modified.Product.fireNodeChanged(org.esa.snap.core.datamodel.ProductNode, java.lang.String, java.lang.Object, java.lang.Object)
public void acceptVisitor(ProductVisitor visitor)
ProductNode
acceptVisitor
in class ProductNode
visitor
- the visitorpublic void dispose()
ProductNode
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.
Overrides of this method should always call super.dispose();
after disposing this instance.
dispose
in class ProductNode
public void updateExpression(String oldExternalName, String newExternalName)
ProductNode
oldExternalName
with oldExternalName
. Such references most often occur
in band arithmetic expressions.updateExpression
in class ProductNode
oldExternalName
- The old node name.newExternalName
- The new node name.Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.