CODA Cursor class.
After you have opened a product file (by constructing a Product instance) you will want to access data from this product and retrieve metadata for the data elements. In order to do this, CODA provides the concept of a 'cursor'. A cursor can be thought of as something that keeps track of a position in the product file and it also stores some extra (type) information about the data element it is currently pointing to. Cursors will start their useful life at the 'root' of a product, i.e., pointing to the entire product, with a type that accurately describes the entire product. From there you can navigate the cursor to the specific data element(s) you want *to access. Note that cursors are used for all products that can be opened with CODA. This includes files in ascii, binary, XML, netCDF, HDF4, or HDF5 format.
The Cursor class is the Java representation of the cursor concept and contains the various methods available for manipulating cursors in CODA.
Cursor | ( | Product | product | ) | throws CodaException |
Construct a Cursor instance to point to an entire Product.
product | A Product instance. |
CodaException | If an error occurred. |
void close | ( | ) | throws CodaException |
Closes an open cursor. The Cursor instance will be invalid after calling this method and should no longer be used.
CodaException | If an error occurred. |
int[] getArrayDim | ( | ) | throws CodaException |
Retrieve the dimensions of the data array that the cursor points to.
CodaException | If an error occurred. |
int getAvailableUnionFieldIndex | ( | ) | throws CodaException |
Determines which union record field is available in the product.
CodaException | If an error occurred. |
long getBitSize | ( | ) | throws CodaException |
Get the bit size for the data at the current cursor position.
CodaException | If an error occurred. |
long getByteSize | ( | ) | throws CodaException |
Get the byte size for the data at the current cursor position.
CodaException | If an error occurred. |
int getDepth | ( | ) | throws CodaException |
Retrieve the current hierarchical depth of the cursor.
CodaException | If an error occurred. |
long getFileBitOffset | ( | ) | throws CodaException |
Retrieve the file offset in bits of the data element that the cursor points to.
CodaException | If an error occurred. |
long getFileByteOffset | ( | ) | throws CodaException |
Retrieve the file offset in bytes of the data element that the cursor points to.
CodaException | If an error occurred. |
FormatEnum getFormat | ( | ) | throws CodaException |
Retrieve the storage format of the data element that the cursor points to.
CodaException | If an error occurred. |
int getIndex | ( | ) | throws CodaException |
Retrieve the array element or field index of the data element that the cursor points to.
CodaException | If an error occurred. |
int getNumElements | ( | ) | throws CodaException |
Gives the number of elements of the data that is pointed to by the cursor.
CodaException | If an error occurred. |
Product getProduct | ( | ) | throws CodaException |
Retrieve the Product that was used to initialize this cursor.
CodaException | If an error occurred. |
NativeTypeEnum getReadType | ( | ) | throws CodaException |
Get the best native type for reading data at the current cursor position.
CodaException | If an error occurred. |
int getRecordFieldAvailableStatus | ( | int | index | ) | throws CodaException |
Determines whether a record field is available in the product.
index | Index of the field (0 <= index < number of fields). |
CodaException | If an error occurred. |
int getRecordFieldIndexFromName | ( | String | name | ) | throws CodaException |
Get the field index from a field name for the record at the current cursor position.
name | Name of the record field. |
CodaException | If an error occurred. |
SpecialTypeEnum getSpecialType | ( | ) | throws CodaException |
Retrieve the special type of the data element that the cursor points to.
CodaException | If an error occurred. |
int getStringLength | ( | ) | throws CodaException |
Get the length in bytes of a string data type.
CodaException | If an error occurred. |
Type getType | ( | ) | throws CodaException |
Retrieve the CODA type of the data element that the cursor points to.
CodaException | If an error occurred. |
TypeClassEnum getTypeClass | ( | ) | throws CodaException |
Retrieve the type class of the data element that the cursor points to.
CodaException | If an error occurred. |
void gotoArrayElement | ( | int[] | subs | ) | throws CodaException |
Moves the cursor to point to an array element via an array of subscripts.
subs | Array of subscripts that identifies the data array element ((0, 0, ..., 0) <= subs < data array dimensions) |
CodaException | If an error occurred. |
void gotoArrayElementByIndex | ( | int | index | ) | throws CodaException |
Moves the cursor to point to an array element via an index.
index | Index of the array element (0 <= index < number of elements) |
CodaException | If an error occurred. |
void gotoAttributes | ( | ) | throws CodaException |
Moves the cursor to point to a (virtual) record containing the attributes of the current data element.
CodaException | If an error occurred. |
void gotoAvailableUnionField | ( | ) | throws CodaException |
Moves the cursor to point to the available union field.
CodaException | If an error occurred. |
void gotoFirstArrayElement | ( | ) | throws CodaException |
CodaException | If an error occurred. |
void gotoFirstRecordField | ( | ) | throws CodaException |
Moves the cursor to point to the first field of a record.
CodaException | If an error occurred. |
void gotoNextArrayElement | ( | ) | throws CodaException |
Moves the cursor to point to the next element of an array.
CodaException | If an error occurred. |
void gotoNextRecordField | ( | ) | throws CodaException |
Moves the cursor to point to the next field of a record.
CodaException | If an error occurred. |
void gotoParent | ( | ) | throws CodaException |
Moves the cursor one level up in the hierarchy.
CodaException | If an error occurred. |
void gotoPath | ( | String | path | ) | throws CodaException |
Moves the cursor to point to the given path.
CodaException | If an error occurred. |
void gotoRecordFieldByIndex | ( | int | index | ) | throws CodaException |
Moves the cursor to point to the field at position index of a record.
index | Index of the field (0 <= index < number of fields). |
CodaException | If an error occurred. |
void gotoRecordFieldByName | ( | String | name | ) | throws CodaException |
Moves the cursor to point to the field of a record that has fieldname name.
name | Fieldname of the field. |
CodaException | If an error occurred. |
void gotoRoot | ( | ) | throws CodaException |
Moves the cursor to the root of the product.
CodaException | If an error occurred. |
boolean hasAsciiContent | ( | ) | throws CodaException |
Determine wether data at the current cursor position is stored as ascii data.
CodaException | If an error occurred. |
boolean hasAttributes | ( | ) | throws CodaException |
Determine wether data at the current cursor position has attributes.
CodaException | If an error occurred. |
byte[] readBits | ( | long | bit_offset, |
long | bit_length ) throws CodaException |
Read a specified amount of bits.
bit_offset | The offset relative to the current cursor position from where the bits should be read. |
bit_length | The number of bits to read. |
CodaException | If an error occurred. |
byte[] readBytes | ( | long | offset, |
long | length ) throws CodaException |
Read a specified amount of bytes.
offset | The offset relative to the current cursor position from where the bytes should be read. |
length | The number of bytes to read. |
CodaException | If an error occurred. |
char readChar | ( | ) | throws CodaException |
Retrieve data as type char
from the product file.
CodaException | If an error occurred. |
char[] readCharArray | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type char
from the product file.
array_ordering |
CodaException | If an error occurred. |
char[] readCharPartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type char
from the product file.
offset | |
length |
CodaException | If an error occurred. |
double readComplexDoublePair | ( | ) | throws CodaException |
Retrieve complex data as type double
from the product file.
CodaException | If an error occurred. |
double[] readComplexDoublePairsArray | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve an array of complex data as type double
from the product file.
array_ordering | Specifies array storage ordering for the return array. Must be ArrayOrderingEnum.coda_array_ordering_c or ArrayOrderingEnum.coda_array_ordering_fortran. |
CodaException | If an error occurred. |
double readDouble | ( | ) | throws CodaException |
Retrieve data as type double
from the product file.
CodaException | If an error occurred. |
double[] readDoubleArray | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type double
from the product file.
array_ordering |
CodaException | If an error occurred. |
double[] readDoublePartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type double
from the product file.
offset | |
length |
CodaException | If an error occurred. |
float readFloat | ( | ) | throws CodaException |
Retrieve data as type float
from the product file.
CodaException | If an error occurred. |
float[] readFloatArray | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type float
from the product file.
array_ordering |
CodaException | If an error occurred. |
float[] readFloatPartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type float
from the product file.
offset | |
length |
CodaException | If an error occurred. |
short readInt16 | ( | ) | throws CodaException |
Retrieve data as type int16
from the product file.
CodaException | If an error occurred. |
short[] readInt16Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type int16
from the product file.
array_ordering |
CodaException | If an error occurred. |
short[] readInt16PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type int16
from the product file.
offset | |
length |
CodaException | If an error occurred. |
int readInt32 | ( | ) | throws CodaException |
Retrieve data as type int32
from the product file.
CodaException | If an error occurred. |
int[] readInt32Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type int32
from the product file.
array_ordering |
CodaException | If an error occurred. |
int[] readInt32PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type int32
from the product file.
offset | |
length |
CodaException | If an error occurred. |
long readInt64 | ( | ) | throws CodaException |
Retrieve data as type int64
from the product file.
CodaException | If an error occurred. |
long[] readInt64Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type int64
from the product file.
array_ordering |
CodaException | If an error occurred. |
long[] readInt64PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type int64
from the product file.
offset | |
length |
CodaException | If an error occurred. |
byte readInt8 | ( | ) | throws CodaException |
Retrieve data as type int8
from the product file.
CodaException | If an error occurred. |
byte[] readInt8Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type int8
from the product file.
array_ordering |
CodaException | If an error occurred. |
byte[] readInt8PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type int8
from the product file.
offset | |
length |
CodaException | If an error occurred. |
String readString | ( | ) | throws CodaException |
Retrieve text data as a Java string.
CodaException | If an error occurred. |
short readUint16 | ( | ) | throws CodaException |
Retrieve data as type uint16
from the product file.
CodaException | If an error occurred. |
short[] readUint16Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type uint16
from the product file.
array_ordering |
CodaException | If an error occurred. |
short[] readUint16PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type uint16
from the product file.
offset | |
length |
CodaException | If an error occurred. |
long readUint32 | ( | ) | throws CodaException |
Retrieve data as type uint32
from the product file.
CodaException | If an error occurred. |
int[] readUint32Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type uint32
from the product file.
array_ordering |
CodaException | If an error occurred. |
int[] readUint32PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type uint32
from the product file.
offset | |
length |
CodaException | If an error occurred. |
long readUint64 | ( | ) | throws CodaException |
Retrieve data as type uint64
from the product file.
CodaException | If an error occurred. |
long[] readUint64Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type uint64
from the product file.
array_ordering |
CodaException | If an error occurred. |
long[] readUint64PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type uint64
from the product file.
offset | |
length |
CodaException | If an error occurred. |
byte readUint8 | ( | ) | throws CodaException |
Retrieve data as type uint8
from the product file.
CodaException | If an error occurred. |
byte[] readUint8Array | ( | ArrayOrderingEnum | array_ordering | ) | throws CodaException |
Retrieve a data array as type uint8
from the product file.
array_ordering |
CodaException | If an error occurred. |
byte[] readUint8PartialArray | ( | int | offset, |
int | length ) throws CodaException |
Retrieve a partial data array as type uint8
from the product file.
offset | |
length |
CodaException | If an error occurred. |
void useBaseTypeOfSpecialType | ( | ) | throws CodaException |
Reinterpret the current special data type using the base type of the special type.
CodaException | If an error occurred. |