org.esa.beam.framework.datamodel
Class ProductData.Float

java.lang.Object
  extended by org.esa.beam.framework.datamodel.ProductData
      extended by org.esa.beam.framework.datamodel.ProductData.Float
All Implemented Interfaces:
Cloneable
Enclosing class:
ProductData

public static class ProductData.Float
extends ProductData

The ProductData.Float class is a ProductData specialisation for 32-bit floating point fields.

Internally, data is stored in an array of the type float[].


Nested Class Summary
 
Nested classes/interfaces inherited from class org.esa.beam.framework.datamodel.ProductData
ProductData.ASCII, ProductData.Byte, ProductData.Double, ProductData.Float, ProductData.Int, ProductData.Short, ProductData.UByte, ProductData.UInt, ProductData.UShort, ProductData.UTC
 
Field Summary
protected  float[] _array
          The internal data array holding this value's data elements.
 
Fields inherited from class org.esa.beam.framework.datamodel.ProductData
TYPE_ASCII, TYPE_FLOAT32, TYPE_FLOAT64, TYPE_INT16, TYPE_INT32, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT8, TYPE_UNDEFINED, TYPE_UTC, TYPESTRING_ASCII, TYPESTRING_FLOAT32, TYPESTRING_FLOAT64, TYPESTRING_INT16, TYPESTRING_INT32, TYPESTRING_INT8, TYPESTRING_UINT16, TYPESTRING_UINT32, TYPESTRING_UINT8, TYPESTRING_UTC
 
Constructor Summary
ProductData.Float(float[] array)
          Constructs a new Float instance for the given array reference.
ProductData.Float(int numElems)
          Constructs a new Float instance with the given number of elements.
 
Method Summary
protected  ProductData createDeepClone()
          Retuns a "deep" copy of this product data.
 void dispose()
          Releases all of the resources used by this object instance and all of its owned children.
 boolean equalElems(ProductData other)
          Tests whether this ProductData is equal to another one.
 float[] getArray()
          Returns the internal data array holding this value's data elements.
 double getElemDoubleAt(int index)
          Please refer to ProductData.getElemDoubleAt(int).
 float getElemFloatAt(int index)
          Please refer to ProductData.getElemFloatAt(int).
 int getElemIntAt(int index)
          Please refer to ProductData.getElemIntAt(int).
 Object getElems()
          Gets the actual value value(s).
 String getElemStringAt(int index)
          Please refer to ProductData.getElemStringAt(int).
 long getElemUIntAt(int index)
          Please refer to ProductData.getElemUIntAt(int).
 int getNumElems()
          Returns the number of data elements this value has.
 void readFrom(int startPos, int numElems, ImageInputStream source)
          Please refer to ProductData.readFrom(int, int, ImageInputStream).
 void setElemDoubleAt(int index, double value)
          Please refer to ProductData.setElemDoubleAt(int, double).
 void setElemFloatAt(int index, float value)
          Please refer to ProductData.setElemFloatAt(int, float).
 void setElemIntAt(int index, int value)
          Please refer to ProductData.setElemIntAt(int, int).
 void setElems(Object data)
          Sets the data of this value.
 void setElemUIntAt(int index, long value)
          Please refer to ProductData.setElemUIntAt(int, long).
 void writeTo(int sourceStartPos, int numSourceElems, ImageOutputStream destination)
          Please refer to ProductData.writeTo(int, int, ImageOutputStream).
 
Methods inherited from class org.esa.beam.framework.datamodel.ProductData
createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createUnsignedInstance, createUnsignedInstance, createUnsignedInstance, equals, getElemBoolean, getElemBooleanAt, getElemDouble, getElemFloat, getElemInt, getElemSize, getElemSize, getElemString, getElemUInt, getType, getType, getTypeString, getTypeString, hashCode, isFloatingPointType, isInt, isIntType, isScalar, isSigned, isUIntType, isUnsigned, readFrom, readFrom, readFrom, setElemBoolean, setElemBooleanAt, setElemDouble, setElemFloat, setElemInt, setElemString, setElemStringAt, setElemUInt, toString, writeTo, writeTo, writeTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_array

protected float[] _array
The internal data array holding this value's data elements.

Constructor Detail

ProductData.Float

public ProductData.Float(float[] array)
Constructs a new Float instance for the given array reference.

Parameters:
array - the array reference

ProductData.Float

public ProductData.Float(int numElems)
Constructs a new Float instance with the given number of elements.

Parameters:
numElems - the number of elements, must not be less than one
Method Detail

createDeepClone

protected ProductData createDeepClone()
Retuns a "deep" copy of this product data.

Specified by:
createDeepClone in class ProductData
Returns:
a copy of this product data

getNumElems

public int getNumElems()
Returns the number of data elements this value has.

Specified by:
getNumElems in class ProductData

getElemIntAt

public int getElemIntAt(int index)
Please refer to ProductData.getElemIntAt(int).

Specified by:
getElemIntAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()

getElemUIntAt

public long getElemUIntAt(int index)
Please refer to ProductData.getElemUIntAt(int).

Specified by:
getElemUIntAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()

getElemFloatAt

public float getElemFloatAt(int index)
Please refer to ProductData.getElemFloatAt(int).

Specified by:
getElemFloatAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()

getElemDoubleAt

public double getElemDoubleAt(int index)
Please refer to ProductData.getElemDoubleAt(int).

Specified by:
getElemDoubleAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()

getElemStringAt

public String getElemStringAt(int index)
Please refer to ProductData.getElemStringAt(int).

Specified by:
getElemStringAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()

setElemIntAt

public void setElemIntAt(int index,
                         int value)
Please refer to ProductData.setElemIntAt(int, int).

Specified by:
setElemIntAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()
value - the value to be set

setElemUIntAt

public void setElemUIntAt(int index,
                          long value)
Please refer to ProductData.setElemUIntAt(int, long).

Specified by:
setElemUIntAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()
value - the value to be set

setElemFloatAt

public void setElemFloatAt(int index,
                           float value)
Please refer to ProductData.setElemFloatAt(int, float).

Specified by:
setElemFloatAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()
value - the value to be set

setElemDoubleAt

public void setElemDoubleAt(int index,
                            double value)
Please refer to ProductData.setElemDoubleAt(int, double).

Specified by:
setElemDoubleAt in class ProductData
Parameters:
index - the value index, must be >=0 and <getNumDataElems()
value - the value to be set

getArray

public final float[] getArray()
Returns the internal data array holding this value's data elements.

Returns:
the internal data array, never null

getElems

public Object getElems()
Gets the actual value value(s). The value returned can safely been casted to an array object of the type float[].

Specified by:
getElems in class ProductData
Returns:
this value's value, always a float[], never null

setElems

public void setElems(Object data)
Sets the data of this value. The data must be an array of the type float[] or String[] and have a length that is equal to the value returned by the getNumDataElems method.

Specified by:
setElems in class ProductData
Parameters:
data - the data array
Throws:
IllegalArgumentException - if data is null or it is not an array of the required type or does not have the required array length.

readFrom

public void readFrom(int startPos,
                     int numElems,
                     ImageInputStream source)
              throws IOException
Please refer to ProductData.readFrom(int, int, ImageInputStream).

Specified by:
readFrom in class ProductData
Parameters:
startPos - the destination start position (zero-based)
numElems - the number of elements to read
source - a seekable data input stream
Throws:
IOException - if an I/O error occurs

writeTo

public void writeTo(int sourceStartPos,
                    int numSourceElems,
                    ImageOutputStream destination)
             throws IOException
Please refer to ProductData.writeTo(int, int, ImageOutputStream).

Specified by:
writeTo in class ProductData
Parameters:
sourceStartPos - the source start position (zero-based)
numSourceElems - the number of elements to be written
destination - a seekable data output stream
Throws:
IOException - if an I/O error occurs

equalElems

public boolean equalElems(ProductData other)
Tests whether this ProductData is equal to another one. Performs an element-wise comparision if the other object is a ProductData instance of the same data type. Otherwise the method behaves like Object.equals(Object).

Overrides:
equalElems in class ProductData
Parameters:
other - the other one

dispose

public void dispose()
Releases 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.

Specified by:
dispose in class ProductData


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.