public static class ProductData.Long extends ProductData
Long
class is a ProductData
specialisation for signed 64-bit integer fields.
Internally, data is stored in an array of the type long[]
.
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 long[] |
_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 |
---|---|
protected |
Long(int numElems)
Constructs a new
long instance. |
protected |
Long(long[] array)
Constructs a new
Long instance. |
Modifier and Type | Method and Description |
---|---|
protected ProductData |
createDeepClone()
Returns 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.
|
long[] |
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, writeTo
protected long[] _array
protected Long(int numElems)
long
instance.numElems
- the number of elements, must not be less than oneprotected Long(long[] array)
Long
instance.array
- the elementsprotected ProductData createDeepClone()
createDeepClone
in class ProductData
public int getNumElems()
getNumElems
in class ProductData
public int getElemIntAt(int index)
ProductData.getElemIntAt(int)
.getElemIntAt
in class ProductData
index
- the value index, must be >=0
and <getNumDataElems()
public long getElemUIntAt(int index)
ProductData.getElemUIntAt(int)
.getElemUIntAt
in class ProductData
index
- the value index, must be >=0
and <getNumDataElems()
public long getElemLongAt(int index)
ProductData.getElemLongAt(int)
.getElemLongAt
in class ProductData
index
- the value index, must be >=0
and <getNumDataElems()
public float getElemFloatAt(int index)
ProductData.getElemFloatAt(int)
.getElemFloatAt
in class ProductData
index
- the value index, must be >=0
and <getNumDataElems()
public double getElemDoubleAt(int index)
ProductData.getElemDoubleAt(int)
.getElemDoubleAt
in class ProductData
index
- the value index, must be >=0
and <getNumDataElems()
public String getElemStringAt(int index)
ProductData.getElemStringAt(int)
.getElemStringAt
in class ProductData
index
- the value index, must be >=0
and <getNumDataElems()
public void setElemIntAt(int index, int value)
ProductData.setElemIntAt(int, int)
.setElemIntAt
in class ProductData
index
- 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 ProductData
index
- 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 ProductData
index
- 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 ProductData
index
- 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 ProductData
index
- the value index, must be >=0
and <getNumDataElems()
value
- the value to be setpublic final long[] getArray()
null
public Object getElems()
int[]
.getElems
in class ProductData
int[]
, never null
public void setElems(Object data)
int[]
or
String[]
and have a length that is equal to the value returned by the
getNumDataElems
method.setElems
in class ProductData
data
- 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 ProductData
startPos
- 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 ProductData
sourceStartPos
- 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 ProductData
Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.