public static class ProductData.UInt extends ProductData.Int
UInt
class is a ProductData
specialisation for unsigned 32-bit integer fields.
Internally, data is stored in an array of the type int[]
.
In order to preserve the accuracy for the unsigned int
value range the
getElemUIntAt
method should be used to retrieve the data stored in this value instead of accessing
the data array directly.
Another method is to mask each of the array elements in order to get the unsigned type in the following way:
int[] data = (int[]) value.getRaster(); for (int i = 0; i %lt; data.length; i++) { long value = data[i] & 0xffffffffL; ... }
ProductData.ASCII, ProductData.Byte, ProductData.Double, ProductData.Float, ProductData.Int, ProductData.Long, ProductData.Short, ProductData.UByte, ProductData.UInt, ProductData.UShort, ProductData.UTC
_array
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 |
---|---|
|
UInt(int numElems)
Constructs a new unsigned
int value. |
|
UInt(int[] array)
Constructs a new unsigned
int value. |
protected |
UInt(long[] elems)
Constructs a new unsigned
int value. |
Modifier and Type | Method and Description |
---|---|
protected ProductData |
createDeepClone()
Retuns a "deep" copy of this product data.
|
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) . |
String |
getElemStringAt(int index)
Please refer to
ProductData.getElemStringAt(int) . |
long |
getElemUIntAt(int index)
Please refer to
ProductData.getElemUIntAt(int) . |
void |
setElems(Object data)
Sets the data of this value.
|
dispose, getArray, getElemLongAt, getElems, getNumElems, readFrom, setElemDoubleAt, setElemFloatAt, setElemIntAt, setElemLongAt, setElemUIntAt, writeTo
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
public UInt(int numElems)
int
value.numElems
- the number of elements, must not be less than onepublic UInt(int[] array)
int
value.array
- the elementsprotected UInt(long[] elems)
int
value.elems
- the elementsprotected ProductData createDeepClone()
createDeepClone
in class ProductData.Int
public int getElemIntAt(int index)
ProductData.getElemIntAt(int)
.
IMPORTANT NOTE: This method returns the data element unchanged as it is sinternally stored (a 32-bit
signed integer) and thus can also return negative values. Use getElemUIntAt
which returns
unsigned long
values only.
getElemIntAt
in class ProductData.Int
index
- the value index, must be >=0
and <getNumDataElems()
public long getElemUIntAt(int index)
ProductData.getElemUIntAt(int)
.getElemUIntAt
in class ProductData.Int
index
- the value index, must be >=0
and <getNumDataElems()
public float getElemFloatAt(int index)
ProductData.getElemFloatAt(int)
.getElemFloatAt
in class ProductData.Int
index
- the value index, must be >=0
and <getNumDataElems()
public double getElemDoubleAt(int index)
ProductData.getElemDoubleAt(int)
.getElemDoubleAt
in class ProductData.Int
index
- the value index, must be >=0
and <getNumDataElems()
public String getElemStringAt(int index)
ProductData.getElemStringAt(int)
.getElemStringAt
in class ProductData.Int
index
- the value index, must be >=0
and <getNumDataElems()
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.Int
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.Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.