Main Page   Classes  

Public Member Functions
DataType Class Reference

List of all members.

Public Member Functions

void close () throws Beatl2Exception
byte[] getUint8 (int numElements) throws Beatl2Exception
byte[] getUint8 (int numElements, int offset) throws Beatl2Exception
int[] getIntegers (int numElements) throws Beatl2Exception
int[] getIntegers (int numElements, int offset) throws Beatl2Exception
double[] getDoubles (int numElements) throws Beatl2Exception
double[] getDoubles (int numElements, int offset) throws Beatl2Exception
String[] getStrings (int numElements) throws Beatl2Exception
String[] getStrings (int numElements, int offset) throws Beatl2Exception
void setDoubles (double[] doubleData) throws Beatl2Exception
void setDoubles (int offset, double[] doubleData) throws Beatl2Exception
void setStrings (String[] stringData) throws Beatl2Exception
void setStrings (int offset, String[] stringData) throws Beatl2Exception
void setIntegers (int[] intData) throws Beatl2Exception
void setIntegers (int offset, int[] intData) throws Beatl2Exception
void setUint8 (byte[] intData) throws Beatl2Exception
void setUint8 (int offset, byte[] intData) throws Beatl2Exception

Detailed Description

BEAT-II DataType class.

In C the data for a BEAT-II record field is retrieved using a generic pointer that can be used to point to arrays of different primitive data types. Such pointers are not supported in Java. To be able to deal with field data from BEAT-II records, the DataType class has been made available. It is the Java representation of such a generic pointer and contains explicitly type retrieval and storage functions for Uint8s (mapped to the Java byte type), Integers (mapped to the Java int type), doubles (mapped to the Java double type) and character pointers (mapped to Java Strings).

The DataType object instance for a specific field is obtained from a BEAT-II Record instance using the getFieldData() method.

With these methods you can provide an offset and number of elements. Using these two parameters it is possible to set/get only part of the field data (the offset/num_elements parameters refer to the field data block, not to your own Java variable).

The offset is a one-dimensional index for the field data. For example, if your field data has dimensions [6,4] then you can read a maximum of 24 elements and the offset parameter can range from 0 to 23. When you set/get field data the funcion will always assume C array ordering (i.e. the last index is the fastest running).


Member Function Documentation

void close ( ) throws Beatl2Exception

Closes an open DataType. The DataType instance will be invalid after calling this method and should no longer be used.

This method will never cause any field data to be deleted. It only cleans up a handle to that data.

Exceptions:
Beatl2ExceptionIf an error occurred.
double [] getDoubles ( int  numElements,
int  offset 
) throws Beatl2Exception

Read an array of doubles.

Parameters:
numElementsThe number of elements to read from the field.
offsetThe offset into the field's array.
Returns:
The data from the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
double [] getDoubles ( int  numElements) throws Beatl2Exception

Read an array of doubles.

Parameters:
numElementsThe number of elements to read from the field.
Returns:
The offset into the field's array.
Exceptions:
Beatl2ExceptionIf an error occurred.
int [] getIntegers ( int  numElements) throws Beatl2Exception

Read an array of integers.

Parameters:
numElementsThe number of elements to read from the field.
Returns:
The data from the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
int [] getIntegers ( int  numElements,
int  offset 
) throws Beatl2Exception

Read an array of integers.

Parameters:
numElementsThe number of elements to read from the field.
offset
Returns:
The data from the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
String [] getStrings ( int  numElements) throws Beatl2Exception

Read an array of Strings.

Parameters:
numElementsThe number of elements to read from the field.
Returns:
The data from the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
String [] getStrings ( int  numElements,
int  offset 
) throws Beatl2Exception

Read an array of Strings.

Parameters:
numElementsThe number of elements to read from the field.
offset
Returns:
The data from the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
byte [] getUint8 ( int  numElements,
int  offset 
) throws Beatl2Exception

Read an array of bytes.

Parameters:
numElementsThe number of elements to read from the field.
offsetThe offset into the field's array.
Returns:
The data from the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
byte [] getUint8 ( int  numElements) throws Beatl2Exception

Read an array of bytes.

Parameters:
numElementsThe number of elements to read from the field.
Returns:
The data from the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setDoubles ( double[]  doubleData) throws Beatl2Exception

Set an array of doubles.

Parameters:
doubleDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setDoubles ( int  offset,
double[]  doubleData 
) throws Beatl2Exception
Parameters:
offsetThe offset into the field's array.
doubleDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setIntegers ( int  offset,
int[]  intData 
) throws Beatl2Exception
Parameters:
offsetThe offset into the field's array.
intDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setIntegers ( int[]  intData) throws Beatl2Exception
Parameters:
intDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setStrings ( String[]  stringData) throws Beatl2Exception
Parameters:
stringDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setStrings ( int  offset,
String[]  stringData 
) throws Beatl2Exception
Parameters:
offsetThe offset into the field's array.
stringDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setUint8 ( int  offset,
byte[]  intData 
) throws Beatl2Exception
Parameters:
offsetThe offset into the field's array.
intDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void setUint8 ( byte[]  intData) throws Beatl2Exception
Parameters:
intDataThe elements to write to the field.
Exceptions:
Beatl2ExceptionIf an error occurred.

The documentation for this class was generated from the following file: