public abstract class ProductNode extends ExtensibleObject
ProductNode is the base class for all nodes within a remote sensing data product and even the data
product itself.| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_NAME_DESCRIPTION |
static String |
PROPERTY_NAME_NAME |
| Modifier | Constructor and Description |
|---|---|
protected |
ProductNode(String name)
Constructs a new product node with the given name.
|
protected |
ProductNode(String name,
String description)
Constructs a new product node with the given name and an optional description.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
acceptVisitor(ProductVisitor visitor)
Accepts the given visitor.
|
void |
dispose()
Releases all of the resources used by this object instance and all of its owned children.
|
void |
fireProductNodeChanged(String propertyName) |
void |
fireProductNodeChanged(String propertyName,
Object oldValue,
Object newValue) |
String |
getDescription()
Returns a short textual description for this products node.
|
String |
getDisplayName()
Returns this node's display name.
|
String |
getName() |
ProductNode |
getOwner() |
Product |
getProduct()
Returns the product to which this node belongs to.
|
ProductReader |
getProductReader()
Returns the product reader for the product to which this node belongs to.
|
protected ProductReader |
getProductReaderSafe()
Returns the product reader for the product to which this node belongs to.
|
String |
getProductRefString()
Gets the product reference string.
|
protected Product |
getProductSafe()
Returns safely the product to which this node belongs to.
|
ProductWriter |
getProductWriter()
Returns the product writer for the product to which this node belongs to.
|
protected ProductWriter |
getProductWriterSafe()
Returns the product writer for the product to which this node belongs to.
|
long |
getRawStorageSize()
Gets an estimated, raw storage size in bytes of this product node.
|
abstract long |
getRawStorageSize(ProductSubsetDef subsetDef)
Gets an estimated, raw storage size in bytes of this product node.
|
boolean |
isModified()
Returns whether or not this node is modified.
|
protected boolean |
isPartOfSubset(ProductSubsetDef subsetDef)
Returns whether or not this node is part of the given subset.
|
static boolean |
isValidNodeName(String name)
Tests whether the given name is valid name for a node.
|
void |
removeFromFile(ProductWriter productWriter)
Physically remove this node from the file associated with the given product writer.
|
void |
setDescription(String description)
Sets a short textual description for this products node.
|
void |
setModified(boolean modified)
Sets this node's modified flag.
|
void |
setName(String name)
Sets this product's name.
|
void |
setOwner(ProductNode owner)
Sets the the owner node of this node.
|
String |
toString() |
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. |
getExtensionpublic static final String PROPERTY_NAME_NAME
public static final String PROPERTY_NAME_DESCRIPTION
protected ProductNode(String name)
name - the node name, must not be nullIllegalArgumentException - if the given name is not a valid node identifierprotected ProductNode(String name, String description)
name - the node name, must not be nulldescription - a descriptive string, can be nullIllegalArgumentException - if the given name is not a valid node identifierpublic void setOwner(ProductNode owner)
Overrides shall finally call super.setOwner(owner).
owner - the new ownerpublic ProductNode getOwner()
public String getName()
public void setName(String name)
name - The name.public String getDescription()
nullpublic void setDescription(String description)
description - a description, can be nullpublic boolean isModified()
true if sopublic void setModified(boolean modified)
If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.
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 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.
Overrides of this method should always call super.dispose(); after disposing this instance.
public static boolean isValidNodeName(String name)
\/:*?"<>|name - the name to testtrue if the name is a valid node identifier, false otherwisepublic Product getProduct()
null if this node was not owned by a product at the time this method was
calledprotected Product getProductSafe() throws IllegalStateException
nullIllegalStateException - if this node does not belong to a productpublic ProductReader getProductReader()
null if no such existsprotected ProductReader getProductReaderSafe()
IllegalStateException if no such reader exists.nullIllegalStateException - if the the product reader is nullpublic ProductWriter getProductWriter()
null if no such existsprotected ProductWriter getProductWriterSafe()
IllegalStateException if no such writer exists.nullIllegalStateException - if the the product writer is nullpublic String getDisplayName()
Example: The string "[2] node-name" means node node-name of the
product with the reference number 2.
nullgetProductRefString()public String getProductRefString()
Example: The string "[2]" stands for a product with the reference number
2.
null if this node has no product null if its product reference number was inactivepublic long getRawStorageSize()
public abstract long getRawStorageSize(ProductSubsetDef subsetDef)
subsetDef - if not null the subset may limit the size returnedpublic void updateExpression(String oldExternalName, String newExternalName)
oldExternalName with oldExternalName. Such references most often occur
in band arithmetic expressions.oldExternalName - The old node name.newExternalName - The new node name.public void fireProductNodeChanged(String propertyName)
public void fireProductNodeChanged(String propertyName, Object oldValue, Object newValue)
public abstract void acceptVisitor(ProductVisitor visitor)
visitor - the visitorprotected boolean isPartOfSubset(ProductSubsetDef subsetDef)
subsetDef - The subset definition.true if the subset is not null and it contains a node name equal to this node's
name.public void removeFromFile(ProductWriter productWriter)
productWriter - the product writer to be used to remove this node from the underlying file.Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.