public abstract class DataNode extends ProductNode
DataNode
is the base class for all nodes within a data product which carry data. The data is
represented by an instance of ProductData
.Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_NAME_DATA |
static String |
PROPERTY_NAME_READ_ONLY |
static String |
PROPERTY_NAME_SYNTHETIC |
static String |
PROPERTY_NAME_UNIT |
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME
Constructor and Description |
---|
DataNode(String name,
int dataType,
long numElems)
Constructs a new data node with the given name, data type and number of elements.
|
DataNode(String name,
ProductData data,
boolean readOnly) |
Modifier and Type | Method and Description |
---|---|
abstract void |
acceptVisitor(ProductVisitor visitor)
Accepts the given visitor.
|
protected void |
checkDataCompatibility(ProductData data)
Checks if the data that should be used to access the data is compatible with the data this node can hold.
|
ProductData |
createCompatibleProductData(int numElems)
Creates product data that is compatible to this dataset's data type.
|
void |
dispose()
Releases all of the resources used by this object instance and all of its owned children.
|
void |
fireProductNodeDataChanged()
Fires a node data changed event.
|
ProductData |
getData()
Gets the data of this data node.
|
Object |
getDataElems()
Gets the data elements of this data node.
|
int |
getDataElemSize()
Gets the data element size in bytes.
|
int |
getDataType()
Gets the data type of this data node.
|
long |
getNumDataElems()
Gets the number of data elements in this data node.
|
long |
getRawStorageSize(ProductSubsetDef subsetDef)
Gets the estimated size in bytes of this product node.
|
String |
getUnit() |
boolean |
isFloatingPointType()
Tests whether the data type of this node is a floating point type.
|
boolean |
isReadOnly() |
boolean |
isSynthetic() |
void |
setData(ProductData data)
Sets the data of this data node.
|
void |
setDataElems(Object elems)
Sets the data elements of this data node.
|
void |
setReadOnly(boolean readOnly) |
void |
setSynthetic(boolean synthetic) |
void |
setUnit(String unit) |
fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setModified, setName, setOwner, toString, updateExpression
getExtension
public static final String PROPERTY_NAME_DATA
public static final String PROPERTY_NAME_READ_ONLY
public static final String PROPERTY_NAME_SYNTHETIC
public static final String PROPERTY_NAME_UNIT
public DataNode(String name, int dataType, long numElems)
public DataNode(String name, ProductData data, boolean readOnly)
public int getDataType()
ProductData.TYPE_X
constantspublic boolean isFloatingPointType()
public long getNumDataElems()
public void setData(ProductData data)
public ProductData getData()
public void setDataElems(Object elems)
ProductData.setElems(Object)
public Object getDataElems()
ProductData.getElems()
public int getDataElemSize()
ProductData.getElemSize(int)
public void setReadOnly(boolean readOnly)
public boolean isReadOnly()
public void setUnit(String unit)
public String getUnit()
public boolean isSynthetic()
public void setSynthetic(boolean synthetic)
public void fireProductNodeDataChanged()
protected void checkDataCompatibility(ProductData data) throws IllegalArgumentException
data
- the data to be checked for compatibilityIllegalArgumentException
- if data is invalid.public abstract void acceptVisitor(ProductVisitor visitor)
acceptVisitor
in class ProductNode
visitor
- the visitor, must not be null
public long getRawStorageSize(ProductSubsetDef subsetDef)
getRawStorageSize
in class ProductNode
subsetDef
- if not null
the subset may limit the size returnedpublic 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.
dispose
in class ProductNode
public ProductData createCompatibleProductData(int numElems)
numElems
elements of a compatible data type.numElems
- the number of elements, must not be less than oneCopyright © 2014–2016 European Space Agency (ESA). All rights reserved.