public abstract class DatasetBase extends AbstractNode implements Dataset
AbstractNode.AttributesLazyInitializer
Modifier and Type | Field and Description |
---|---|
protected HdfBackingStorage |
hdfBackingStorage |
protected ObjectHeader |
oh |
address, attributes, header, name, parent
Modifier | Constructor and Description |
---|---|
protected |
DatasetBase(HdfBackingStorage hdfBackingStorage,
long address,
java.lang.String name,
Group parent,
ObjectHeader oh) |
Modifier and Type | Method and Description |
---|---|
protected void |
convertToCorrectEndiness(java.nio.ByteBuffer bb) |
java.lang.Object |
getData()
Gets the data from the HDF5 dataset and converts it to a Java object.
|
java.lang.Object |
getData(long[] sliceOffset,
int[] sliceDimensions)
Gets a slice of data from the HDF5 dataset and converts it to a Java object.
|
abstract java.nio.ByteBuffer |
getDataBuffer()
Gets the buffer that holds this datasets data.
|
java.lang.Object |
getDataFlat()
Gets the data from the HDF5 dataset and converts it to a Java object, it differs from
Dataset.getData() as the
data will be flat (i.e. |
DataLayout |
getDataLayout()
Gets the data layout of this dataset.
|
DataType |
getDataType()
Gets the
DataType that is used to represent the data in the HDF5-file. |
int[] |
getDimensions()
Gets the dimensions of this dataset
|
java.lang.Object |
getFillValue()
Gets the fill value for this dataset or
null if not defined. |
java.lang.Class<?> |
getJavaType()
Gets the Java type that will be used to represent this data.
|
long[] |
getMaxSize()
Gets the max size of this dataset.
|
long |
getSize()
Gets the total number of elements in this dataset.
|
long |
getSizeInBytes()
Gets the size of this dataset.
|
abstract java.nio.ByteBuffer |
getSliceDataBuffer(long[] offset,
int[] shape) |
long |
getStorageInBytes()
Gets the size of the storage used for this dataset in bytes.
|
NodeType |
getType()
Gets the type of this
Node . |
boolean |
isCompound()
Checks if this dataset is a compound 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.
|
boolean |
isVariableLength()
Checks if this dataset is a variable length dataset.
|
java.lang.String |
toString() |
getAddress, getAttribute, getAttributes, getFile, getFileAsPath, getHdfFile, getHeader, getHeaderMessage, getName, getParent, getPath, isAttributeCreationOrderTracked, isGroup, isLink
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFilters
getAddress, getAttribute, getAttributes, getFile, getFileAsPath, getHdfFile, getName, getParent, getPath, isAttributeCreationOrderTracked, isGroup, isLink
protected final HdfBackingStorage hdfBackingStorage
protected final ObjectHeader oh
protected DatasetBase(HdfBackingStorage hdfBackingStorage, long address, java.lang.String name, Group parent, ObjectHeader oh)
public NodeType getType()
Node
Node
.protected void convertToCorrectEndiness(java.nio.ByteBuffer bb)
public long getSize()
Dataset
public long getSizeInBytes()
Dataset
number of elements * size of each element
getSizeInBytes
in interface Dataset
public int[] getDimensions()
Dataset
getDimensions
in interface Dataset
public long[] getMaxSize()
Dataset
Dataset.getDimensions()
getMaxSize
in interface Dataset
public DataLayout getDataLayout()
Dataset
getDataLayout
in interface Dataset
public java.lang.Class<?> getJavaType()
Dataset
getJavaType
in interface Dataset
public DataType getDataType()
Dataset
DataType
that is used to represent the data in the HDF5-file.getDataType
in interface Dataset
public java.lang.Object getData()
Dataset
The returned type will be either:
Dataset.getJavaType()
if the
dataset is scalar (Dataset.isScalar()
).Dataset.getDimensions()
. The type of the array will be the return value of
Dataset.getJavaType()
.Map
if Dataset.isCompound()
returns true
null
if the dataset is empty (Dataset.isEmpty()
).public java.lang.Object getDataFlat()
Dataset
Dataset.getData()
as the
data will be flat (i.e. 1D). Can offer improved performance over Dataset.getData()
for multiple dimension
arrays.
The type of the returned array will be that returned by Dataset.getJavaType()
. The size of the array returned
will be the product of the dataset dimensions. For empty datasets an empty array will be returned. For scalar
datasets an array with a single element will be returned.
getDataFlat
in interface Dataset
public java.lang.Object getData(long[] sliceOffset, int[] sliceDimensions)
Dataset
The returned object will be an array with the dimensions specified by sliceDimensions
and type of
the array will be the return value of Dataset.getJavaType()
.
getData
in interface Dataset
sliceOffset
- the position in the dataset the slice starts. Must have length equal to number of dimensionssliceDimensions
- the dimensions of the slice to return. Must have length equal to number of dimensionspublic boolean isScalar()
Dataset
public boolean isEmpty()
Dataset
public boolean isCompound()
Dataset
isCompound
in interface Dataset
true
if this is a compound dataset, false
otherwisepublic abstract java.nio.ByteBuffer getDataBuffer()
public abstract java.nio.ByteBuffer getSliceDataBuffer(long[] offset, int[] shape)
public java.lang.Object getFillValue()
Dataset
null
if not defined. If
it is defined the type will be that returned by Dataset.getJavaType()
.getFillValue
in interface Dataset
null
if not definedpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean isVariableLength()
Dataset
isVariableLength
in interface Dataset
true
if this is a variable length dataset, false
otherwisepublic long getStorageInBytes()
Dataset
Dataset.getSizeInBytes()
due to the use of compression.getStorageInBytes
in interface Dataset