Package io.jhdf.api
Interface Dataset
-
- All Superinterfaces:
Node
- All Known Implementing Classes:
ChunkedDatasetV3
,CompactDataset
,ContiguousDataset
,DatasetBase
public interface Dataset extends Node
HDF5 dataset. Datasets contain the real data within a HDF5 file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
getData()
Gets the data from the HDF5 dataset and converts it to a Java object.DataLayout
getDataLayout()
Gets the data layout of this dataset.int[]
getDimensions()
Gets the dimensions of this datasetlong
getDiskSize()
Gets the disk size used by this dataset.java.lang.Object
getFillValue()
Gets the fill value for this dataset ornull
if not defined.java.lang.Class<?>
getJavaType()
Gets the Java type that will be used to represent this data.int[]
getMaxSize()
Gets the max size of this dataset.long
getSize()
Gets the total number of elements in this dataset.boolean
isEmpty()
Checks if this dataset is empty i.e holds no data and no storage is allocated.boolean
isScalar()
Checks if this dataset is scalar i.e is a single element with no dimensions.-
Methods inherited from interface io.jhdf.api.Node
getAddress, getAttribute, getAttributes, getFile, getHdfFile, getName, getParent, getPath, getType, isAttributeCreationOrderTracked, isGroup, isLink
-
-
-
-
Method Detail
-
getSize
long getSize()
Gets the total number of elements in this dataset.- Returns:
- the total number of elements in this dataset
-
getDiskSize
long getDiskSize()
Gets the disk size used by this dataset.i.e. number of elements * size of each element
- Returns:
- the total number of bytes the dataset is using
-
getDimensions
int[] getDimensions()
Gets the dimensions of this dataset- Returns:
- the dimensions of this dataset
-
isScalar
boolean isScalar()
Checks if this dataset is scalar i.e is a single element with no dimensions.- Returns:
true
if dataset if scalarfalse
otherwise
-
isEmpty
boolean isEmpty()
Checks if this dataset is empty i.e holds no data and no storage is allocated.- Returns:
true
if dataset if emptyfalse
otherwise
-
getMaxSize
int[] getMaxSize()
Gets the max size of this dataset. If not specified this will be equal togetDimensions()
- Returns:
- the max size of this dataset
-
getDataLayout
DataLayout getDataLayout()
Gets the data layout of this dataset.- Returns:
- the data layout of this dataset
-
getData
java.lang.Object getData()
Gets the data from the HDF5 dataset and converts it to a Java object.The returned type will be either:
- A Java object of the type returned by
getJavaType()
if the dataset is scalar (isScalar()
). - A Java array of dimensions of the dataset as returned by
getDimensions()
. The type of the array will be the return value ofgetJavaType()
. null
if the dataset if empty (isEmpty()
).
- Returns:
- the data in the dataset as a Java object or
null
if the dataset is empty.
- A Java object of the type returned by
-
getJavaType
java.lang.Class<?> getJavaType()
Gets the Java type that will be used to represent this data.- Returns:
- the Java type used to represent this dataset
-
getFillValue
java.lang.Object getFillValue()
Gets the fill value for this dataset ornull
if not defined. If it is defined the type will be that returned bygetJavaType()
.- Returns:
- the fill value of the dataset or
null
if not defined
-
-