Package org.esa.snap.core.datamodel
Class ProductNodeGroup<T extends ProductNode>
java.lang.Object
com.bc.ceres.core.ExtensibleObject
org.esa.snap.core.datamodel.ProductNode
org.esa.snap.core.datamodel.ProductNodeGroup<T>
- All Implemented Interfaces:
Extensible
- Direct Known Subclasses:
PlacemarkGroup
A type-safe container for elements of the type
ProductNode.-
Field Summary
Fields inherited from class org.esa.snap.core.datamodel.ProductNode
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME -
Constructor Summary
ConstructorsConstructorDescriptionProductNodeGroup(String name) Constructs a node group with no owner and which will not take ownership of added children.ProductNodeGroup(ProductNode owner, String name, boolean takingOverNodeOwnership) Constructs a node group for the given owner. -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptVisitor(ProductVisitor visitor) Accepts the given visitor.voidAdds the given node to this group.booleanAdds the given node to this group.voidbooleanTests whether a node with the given name is contained in this group.booleanTests whether the given product is contained in this list.voiddispose()Releases all of the resources used by this object instance and all of its owned children.get(int index) getByDisplayName(String displayName) intString[]Returns the display names of all products currently managed.String[]Returns the names of all products currently managed.longgetRawStorageSize(ProductSubsetDef subsetDef) Gets an estimated, raw storage size in bytes of this product node.Gets all removed node nodes.intintbooleanbooleanRemoves the given node from this group.voidRemoves all nodes from this group.voidsetModified(boolean modified) Sets this node's modified flag.toArray()Returns an array of all products currently managed.T[]voidupdateExpression(String oldExternalName, String newExternalName) Asks a product node to replace all occurences of and references to the node name given byoldExternalNamewitholdExternalName.Methods inherited from class org.esa.snap.core.datamodel.ProductNode
fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, setNodeName, setOwner, toStringMethods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
Constructor Details
-
ProductNodeGroup
Constructs a node group with no owner and which will not take ownership of added children.- Parameters:
name- The group name.- Since:
- BEAM 4.8
-
ProductNodeGroup
Constructs a node group for the given owner.- Parameters:
owner- The owner of the group.name- The group name.takingOverNodeOwnership- Iftrue, child nodes will have this group as owner after adding.
-
-
Method Details
-
isTakingOverNodeOwnership
public boolean isTakingOverNodeOwnership()- Returns:
true, if child nodes will have this group as owner after adding.
-
getNodeCount
public int getNodeCount()- Returns:
- The number of product nodes in this product group.
-
get
- Parameters:
index- The node index.- Returns:
- The product node at the given index.
-
getNodeDisplayNames
Returns the display names of all products currently managed.- Returns:
- an array containing the display names, never
null, but the array can have zero length - See Also:
-
getNodeNames
Returns the names of all products currently managed.- Returns:
- an array containing the names, never
null, but the array can have zero length
-
toArray
Returns an array of all products currently managed.- Returns:
- an array containing the products, never
null, but the array can have zero length
-
toArray
- Parameters:
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.- Returns:
- an array containing the product nodes, never
null, but the array can have zero length
-
indexOf
-
indexOf
-
getByDisplayName
- Parameters:
displayName- the display name- Returns:
- the product node with the given display name.
-
get
- Parameters:
name- the name- Returns:
- the product node with the given name or
nullis a node with the name is not contained in the group.
-
contains
Tests whether a node with the given name is contained in this group.- Parameters:
name- the name- Returns:
- true, if so
-
contains
Tests whether the given product is contained in this list.- Parameters:
node- the node- Returns:
- true, if so
-
add
Adds the given node to this group.- Parameters:
node- the node to be added, ignored ifnull- Returns:
- true, if the node has been added
-
add
Adds the given node to this group.- Parameters:
index- the index.node- the node to be added, ignored ifnull
-
remove
Removes the given node from this group.- Parameters:
node- the node to be removed- Returns:
- true, if the node was removed
-
removeAll
public void removeAll()Removes all nodes from this group. -
clearRemovedList
public void clearRemovedList() -
getRemovedNodes
Gets all removed node nodes.- Returns:
- a collection of all removed node nodes.
-
getRawStorageSize
Description copied from class:ProductNodeGets an estimated, raw storage size in bytes of this product node.- Specified by:
getRawStorageSizein classProductNode- Parameters:
subsetDef- if notnullthe subset may limit the size returned- Returns:
- the size in bytes.
-
setModified
public void setModified(boolean modified) Description copied from class:ProductNodeSets this node's modified flag.If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.
- Overrides:
setModifiedin classProductNode- Parameters:
modified- whether or not this node is beeing marked as modified.- See Also:
-
acceptVisitor
Description copied from class:ProductNodeAccepts the given visitor. This method implements the well known 'Visitor' design pattern of the gang-of-four. The visitor pattern allows to define new operations on the product data model without the need to add more code to it. The new operation is implemented by the visitor.- Specified by:
acceptVisitorin classProductNode- Parameters:
visitor- the visitor
-
dispose
public void dispose()Description copied from class:ProductNodeReleases all of the resources used by this object instance and all of its owned children. Its primary use is to allow the garbage collector to perform a vanilla job.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.- Overrides:
disposein classProductNode
-
updateExpression
Description copied from class:ProductNodeAsks a product node to replace all occurences of and references to the node name given byoldExternalNamewitholdExternalName. Such references most often occur in band arithmetic expressions.- Overrides:
updateExpressionin classProductNode- Parameters:
oldExternalName- The old node name.newExternalName- The new node name.
-