- All Known Subinterfaces:
- CompoundDataFormat
- All Known Implementing Classes:
- Attribute,- CompoundDS,- Dataset,- FitsDataset,- H4Attribute,- H4GRImage,- H4SDS,- H4Vdata,- H5Attribute,- H5CompoundDS,- H5ScalarDS,- NC2Attribute,- NC2Dataset,- ScalarDS
- Version:
- 1.0 4/2/2018
- Author:
- Jordan T. Henderson
- See Also:
- HObject
- 
Method SummaryModifier and TypeMethodDescriptionvoidClears the current data buffer in memory and forces the next read() to load the data from file.Converts the data values of this data object to appropriate Java integers if they are unsigned integers.Converts Java integer data values of this data object back to unsigned C-type integer data if they are unsigned integers.Returns the string representation of compression information.getData()Retrieves the object's data from the file.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.Returns the fill values for the data object.longReturns the dimension size of the vertical axis.Get runtime Class of the original data buffer if converted.intgetRank()Returns the rank (number of dimensions) of the data object.long[]Returns the dimension sizes of the selected subset.int[]Returns the indices of display order.long[]Returns the starting position of a selected subset.long[]Returns the selectedStride of the selected dataset.longgetWidth()Returns the dimension size of the horizontal axis.voidinit()booleanisInited()read()Reads the data from file.voidvoidwrite()Writes the current memory buffer to the object in the file.voidWrites a memory buffer to the object in the file.
- 
Method Details- 
isInitedboolean isInited()
- 
initvoid init()
- 
getDataRetrieves the object's data from the file.- Returns:
- the object's data.
- Throws:
- Exception- if the data can not be retrieved
- OutOfMemoryError
 
- 
setData- Parameters:
- data- the data to write.
 
- 
clearDatavoid clearData()Clears the current data buffer in memory and forces the next read() to load the data from file.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. 
- 
readReads the data from file.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. - Returns:
- the data read from file.
- Throws:
- Exception- if object can not be read
- OutOfMemoryError- if memory is exhausted
- See Also:
- getData()
 
- 
writeWrites a memory buffer to the object in the file.- Parameters:
- buf- the data to write
- Throws:
- Exception- if data can not be written
 
- 
writeWrites the current memory buffer to the object in the file.- Throws:
- Exception- if data can not be written
 
- 
convertFromUnsignedCConverts the data values of this data object to appropriate Java integers if they are unsigned integers.- Returns:
- the converted data buffer.
- See Also:
- Dataset.convertToUnsignedC(Object),- Dataset.convertFromUnsignedC(Object, Object)
 
- 
convertToUnsignedCConverts Java integer data values of this data object back to unsigned C-type integer data if they are unsigned integers.- Returns:
- the converted data buffer.
- See Also:
- Dataset.convertToUnsignedC(Object),- Dataset.convertToUnsignedC(Object, Object)
 
- 
getFillValueReturns the fill values for the data object.- Returns:
- the fill values for the data object.
 
- 
getDatatypeReturns the datatype of the data object.- Returns:
- the datatype of the data object.
 
- 
getRankint getRank()Returns the rank (number of dimensions) of the data object. It returns a negative number if it failed to retrieve the dimension information from the file.- Returns:
- the number of dimensions of the data object.
 
- 
getDimslong[] getDims()Returns the array that contains the dimension sizes of the data value of the data object. It returns null if it failed to retrieve the dimension information from the file.- Returns:
- the dimension sizes of the data object.
 
- 
getSelectedDimslong[] getSelectedDims()Returns the dimension sizes of the selected subset.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- Returns:
- the dimension sizes of the selected subset.
 
- 
getStartDimslong[] getStartDims()Returns the starting position of a selected subset.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- Returns:
- the starting position of a selected subset.
 
- 
getStridelong[] getStride()Returns the selectedStride of the selected dataset.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- Returns:
- the selectedStride of the selected dataset.
 
- 
getSelectedIndexint[] getSelectedIndex()Returns the indices of display order.selectedIndex[] is provided for two purposes: - selectedIndex[] is used to indicate the order of dimensions for display.
 selectedIndex[0] is for the row, selectedIndex[1] is for the column and
 selectedIndex[2] for the depth.
 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. 
- selectedIndex[] is also used to select dimensions for display for
 datasets with three or more dimensions. We assume that applications such as
 HDFView can only display data values up to three dimensions (2D
 spreadsheet/image with a third dimension which the 2D spreadsheet/image is
 selected from). For datasets with more than three dimensions, we need
 selectedIndex[] to tell applications which three dimensions are chosen for
 display. 
 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. dim[0] is not selected. Its location is fixed at 0 by default.
 - Returns:
- the array of the indices of display order.
 
- selectedIndex[] is used to indicate the order of dimensions for display.
 selectedIndex[0] is for the row, selectedIndex[1] is for the column and
 selectedIndex[2] for the depth.
 
- 
getHeightlong getHeight()Returns the dimension size of the vertical axis.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: - selectedIndex[0] -- height
- The vertical axis
- selectedIndex[1] -- width
- The horizontal axis
- selectedIndex[2] -- depth
- The depth axis is used for 3 or more dimensional datasets.
 int[] selectedIndex = dataset.getSelectedIndex(); selectedIndex[0] = 0; selectedIndex[1] = 1; - Returns:
- the size of dimension of the vertical axis.
- See Also:
- getSelectedIndex(),- getWidth()
 
- 
getWidthlong getWidth()Returns the dimension size of the horizontal axis.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: - selectedIndex[0] -- height
- The vertical axis
- selectedIndex[1] -- width
- The horizontal axis
- selectedIndex[2] -- depth
- The depth axis, which is used for 3 or more dimension datasets.
 int[] selectedIndex = dataset.getSelectedIndex(); selectedIndex[0] = 0; selectedIndex[1] = 1; - Returns:
- the size of dimension of the horizontal axis.
- See Also:
- getSelectedIndex(),- getHeight()
 
- 
getCompressionReturns the string representation of compression information.For example, "SZIP: Pixels per block = 8: H5Z_FILTER_CONFIG_DECODE_ENABLED". - Returns:
- the string representation of compression information.
 
- 
getOriginalClassGet runtime Class of the original data buffer if converted.- Returns:
- the Class of the original data buffer
 
 
-