public static class ProductData.Byte extends ProductData
Byte class is a ProductData specialisation for signed 8-bit integer fields.
Internally, data is stored in an array of the type byte[].
ProductData.ASCII, ProductData.Byte, ProductData.Double, ProductData.Float, ProductData.Int, ProductData.Long, ProductData.Short, ProductData.UByte, ProductData.UInt, ProductData.UShort, ProductData.UTC| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
_array
The internal data array holding this value's data elements.
|
TYPE_ASCII, TYPE_FLOAT32, TYPE_FLOAT64, TYPE_INT16, TYPE_INT32, TYPE_INT64, TYPE_INT8, TYPE_UINT16, TYPE_UINT32, TYPE_UINT8, TYPE_UNDEFINED, TYPE_UTC, TYPESTRING_ASCII, TYPESTRING_FLOAT32, TYPESTRING_FLOAT64, TYPESTRING_INT16, TYPESTRING_INT32, TYPESTRING_INT64, TYPESTRING_INT8, TYPESTRING_UINT16, TYPESTRING_UINT32, TYPESTRING_UINT8, TYPESTRING_UTC| Modifier | Constructor and Description |
|---|---|
|
Byte(byte[] array)
Constructs a new signed
byte value. |
protected |
Byte(byte[] array,
boolean unsigned)
Constructs a new signed
byte value. |
protected |
Byte(byte[] array,
int type)
Constructs a new signed
byte value. |
|
Byte(int numElems)
Constructs a new signed
byte value. |
protected |
Byte(int numElems,
boolean unsigned)
Constructs a new signed
byte value. |
protected |
Byte(int numElems,
int type)
Constructs a new signed
byte value. |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
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.
|
byte[] |
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). |
long |
getElemLongAt(int index)
Please refer to
ProductData.getElemLongAt(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 |
setElemLongAt(int index,
long value)
Please refer to
ProductData.setElemLongAt(int, long). |
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). |
createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createInstance, createUnsignedInstance, createUnsignedInstance, createUnsignedInstance, equalElems, equals, getElemBoolean, getElemBooleanAt, getElemDouble, getElemFloat, getElemInt, getElemLong, getElemSize, getElemSize, getElemString, getElemUInt, getType, getType, getTypeString, getTypeString, hashCode, isFloatingPointType, isInt, isIntType, isScalar, isSigned, isUIntType, isUnsigned, readFrom, readFrom, readFrom, setElemBoolean, setElemBooleanAt, setElemDouble, setElemFloat, setElemInt, setElemLong, setElemString, setElemStringAt, setElemUInt, toString, writeTo, writeTo, writeToprotected byte[] _array
public Byte(int numElems)
byte value.numElems - the number of elements, must not be less than onepublic Byte(byte[] array)
byte value.array - the elementsprotected Byte(int numElems,
int type)
byte value.numElems - the number of elements, must not be less than onetype - must be one of TYPE_UINT8, TYPE_INT8 or TYPE_ASCIIprotected Byte(int numElems,
boolean unsigned)
byte value.numElems - the number of elements, must not be less than oneunsigned - if true an unsigned value type is constructedprotected Byte(byte[] array,
boolean unsigned)
byte value.array - the elementsunsigned - if true an unsigned value type is constructedprotected Byte(byte[] array,
int type)
byte value.array - the elementstype - must be one of TYPE_UINT8, TYPE_INT8 or TYPE_ASCIIprotected ProductData createDeepClone()
createDeepClone in class ProductDatapublic int getNumElems()
getNumElems in class ProductDatapublic int getElemIntAt(int index)
ProductData.getElemIntAt(int).getElemIntAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()public long getElemUIntAt(int index)
ProductData.getElemUIntAt(int).getElemUIntAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()public long getElemLongAt(int index)
ProductData.getElemLongAt(int).getElemLongAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()public float getElemFloatAt(int index)
ProductData.getElemFloatAt(int).getElemFloatAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()public double getElemDoubleAt(int index)
ProductData.getElemDoubleAt(int).getElemDoubleAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()public String getElemStringAt(int index)
ProductData.getElemStringAt(int).getElemStringAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()public void setElemIntAt(int index,
int value)
ProductData.setElemIntAt(int, int).setElemIntAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()value - the value to be setpublic void setElemUIntAt(int index,
long value)
ProductData.setElemUIntAt(int, long).setElemUIntAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()value - the value to be setpublic void setElemLongAt(int index,
long value)
ProductData.setElemLongAt(int, long).setElemLongAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()value - the value to be setpublic void setElemFloatAt(int index,
float value)
ProductData.setElemFloatAt(int, float).setElemFloatAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()value - the value to be setpublic void setElemDoubleAt(int index,
double value)
ProductData.setElemDoubleAt(int, double).setElemDoubleAt in class ProductDataindex - the value index, must be >=0 and <getNumDataElems()value - the value to be setpublic final byte[] getArray()
nullpublic Object getElems()
byte[].getElems in class ProductDatabyte[], never nullpublic void setElems(Object data)
byte[] or
String[] and have a length that is equal to the value returned by the
getNumDataElems method.setElems in class ProductDatadata - the data arrayIllegalArgumentException - if data is null or it is not an array of the required type or
does not have the required array length.public void readFrom(int startPos,
int numElems,
ImageInputStream source)
throws IOException
ProductData.readFrom(int, int, ImageInputStream).readFrom in class ProductDatastartPos - the destination start position (zero-based)numElems - the number of elements to readsource - a seekable data input streamIOException - if an I/O error occurspublic void writeTo(int sourceStartPos,
int numSourceElems,
ImageOutputStream destination)
throws IOException
ProductData.writeTo(int, int, ImageOutputStream).writeTo in class ProductDatasourceStartPos - the source start position (zero-based)numSourceElems - the number of elements to be writtendestination - a seekable data output streamIOException - if an I/O error occurspublic 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 ProductDataCopyright © 2014–2017 European Space Agency (ESA). All rights reserved.