public interface DataFormat
HObject
Modifier and Type | Method and Description |
---|---|
void |
clearData()
Clears the current data buffer in memory and forces the next read() to load
the data from file.
|
Object |
convertFromUnsignedC()
Converts the data values of this data object to appropriate Java integers if
they are unsigned integers.
|
Object |
convertToUnsignedC()
Converts Java integer data values of this data object back to unsigned C-type
integer data if they are unsigned integers.
|
String |
getCompression()
Returns the string representation of compression information.
|
Object |
getData()
Retrieves the object's data from the file.
|
Datatype |
getDatatype()
Returns the datatype of the data object.
|
long[] |
getDims()
Returns the array that contains the dimension sizes of the data value of
the data object.
|
Object |
getFillValue()
Returns the fill values for the data object.
|
long |
getHeight()
Returns the dimension size of the vertical axis.
|
Class |
getOriginalClass()
Get runtime Class of the original data buffer if converted.
|
int |
getRank()
Returns the rank (number of dimensions) of the data object.
|
long[] |
getSelectedDims()
Returns the dimension sizes of the selected subset.
|
int[] |
getSelectedIndex()
Returns the indices of display order.
|
long[] |
getStartDims()
Returns the starting position of a selected subset.
|
long[] |
getStride()
Returns the selectedStride of the selected dataset.
|
long |
getWidth()
Returns the dimension size of the horizontal axis.
|
void |
init() |
boolean |
isInited() |
Object |
read()
Reads the data from file.
|
void |
setData(Object data) |
void |
write()
Writes the current memory buffer to the object in the file.
|
void |
write(Object buf)
Writes a memory buffer to the object in the file.
|
boolean isInited()
void init()
Object getData() throws Exception, OutOfMemoryError
Exception
- if the data can not be retrievedOutOfMemoryError
void setData(Object data)
data
- the data to write.void clearData()
The function read() loads data from file into memory only if the data is not read. If data is already in memory, read() just returns the memory buffer. Sometimes we want to force read() to re-read data from file. For example, when the selection is changed, we need to re-read the data.
Object read() throws Exception, OutOfMemoryError
read() reads the data from file to a memory buffer and returns the memory buffer. The dataset object does not hold the memory buffer. To store the memory buffer in the dataset object, one must call getData().
By default, the whole dataset is read into memory. Users can also select a subset to read. Subsetting is done in an implicit way.
Exception
- if object can not be readOutOfMemoryError
- if memory is exhaustedgetData()
void write(Object buf) throws Exception
buf
- the data to writeException
- if data can not be writtenvoid write() throws Exception
Exception
- if data can not be writtenObject convertFromUnsignedC()
Dataset.convertToUnsignedC(Object)
,
Dataset.convertFromUnsignedC(Object, Object)
Object convertToUnsignedC()
Dataset.convertToUnsignedC(Object)
,
Dataset.convertToUnsignedC(Object, Object)
Object getFillValue()
Datatype getDatatype()
int getRank()
long[] getDims()
long[] getSelectedDims()
The SelectedDims is the number of data points of the selected subset. Applications can use this array to change the size of selected subset. The selected size must be less than or equal to the current dimension size. Combined with the starting position, selected sizes and stride, the subset of a rectangle selection is fully defined.
For example, if a 4 X 5 dataset is as follows:
0, 1, 2, 3, 4 10, 11, 12, 13, 14 20, 21, 22, 23, 24 30, 31, 32, 33, 34 long[] dims = {4, 5}; long[] startDims = {1, 2}; long[] selectedDims = {3, 3}; long[] selectedStride = {1, 1}; then the following subset is selected by the startDims and selectedDims 12, 13, 14 22, 23, 24 32, 33, 34
long[] getStartDims()
Applications can use this array to change the starting position of a selection. Combined with the selected dimensions, selected sizes and stride, the subset of a rectangle selection is fully defined.
For example, if a 4 X 5 dataset is as follows:
0, 1, 2, 3, 4 10, 11, 12, 13, 14 20, 21, 22, 23, 24 30, 31, 32, 33, 34 long[] dims = {4, 5}; long[] startDims = {1, 2}; long[] selectedDims = {3, 3}; long[] selectedStride = {1, 1}; then the following subset is selected by the startDims and selectedDims 12, 13, 14 22, 23, 24 32, 33, 34
long[] getStride()
Applications can use this array to change how many elements to move in each dimension. Combined with the starting position and selected sizes, the subset of a rectangle selection is defined.
For example, if a 4 X 5 dataset is as follows:
0, 1, 2, 3, 4 10, 11, 12, 13, 14 20, 21, 22, 23, 24 30, 31, 32, 33, 34 long[] dims = {4, 5}; long[] startDims = {0, 0}; long[] selectedDims = {2, 2}; long[] selectedStride = {2, 3}; then the following subset is selected by the startDims and selectedDims 0, 3 20, 23
int[] getSelectedIndex()
selectedIndex[] is provided for two purposes:
For example, for a four dimension dataset, if selectedIndex[] = {1, 2, 3}, then dim[1] is selected as row index, dim[2] is selected as column index and dim[3] is selected as depth index.
long getHeight()
This function is used by GUI applications such as HDFView. GUI applications display a dataset in a 2D table or 2D image. The display order is specified by the index array of selectedIndex as follow:
int[] selectedIndex = dataset.getSelectedIndex(); selectedIndex[0] = 0; selectedIndex[1] = 1;
getSelectedIndex()
,
getWidth()
long getWidth()
This function is used by GUI applications such as HDFView. GUI applications display a dataset in 2D Table or 2D Image. The display order is specified by the index array of selectedIndex as follow:
int[] selectedIndex = dataset.getSelectedIndex(); selectedIndex[0] = 0; selectedIndex[1] = 1;
getSelectedIndex()
,
getHeight()
String getCompression()
For example, "SZIP: Pixels per block = 8: H5Z_FILTER_CONFIG_DECODE_ENABLED".
Class getOriginalClass()
Copyright © 2018. All Rights Reserved.