Package nz.org.riskscape.hdf5.types
Class H5Type
java.lang.Object
nz.org.riskscape.hdf5.H5Object
nz.org.riskscape.hdf5.types.H5Type
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
H5ArrayType
,H5CompoundType
,H5EnumType
,H5FloatType
,H5IntegerType
,H5StringType
,H5VlenType
Represents an H5 data type, with some conveniences for mapping these to Riskscape types. Each type should produce native java objects that can be coerced easily by the riskscape type it maps to
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic H5Type
build
(long id) protected boolean
void
close()
boolean
long
The size in bytes of any element of this type.int
hashCode()
abstract boolean
abstract Object
read
(ByteBuffer outBuf, int offset) Object[]
readVlen
(byte[] rawBytes) Special case read method for reading variable length data from the result of a call to H5.h5d_readVL.abstract String
toString()
abstract nz.org.riskscape.engine.types.Type
toType()
Methods inherited from class nz.org.riskscape.hdf5.H5Object
getPointer
-
Constructor Details
-
H5Type
protected H5Type(long ptr)
-
-
Method Details
-
build
-
toType
public abstract nz.org.riskscape.engine.types.Type toType()- Returns:
- a Riskscape type that mirrors the HD5 data type
-
read
- Returns:
- a java object that represents the data that was stored in the outBuf if it was of this data type.
This java object should be coercable in to the type returned from
toType()
-
getClassName
- Returns:
- the H5 library's name for this type
-
toString
-
isVariableLength
public abstract boolean isVariableLength()- Returns:
- true if this type is, or contains something, of variable length. As yet, this H5 support in this plugin can not read datasets of variable length type
-
readVlen
Special case read method for reading variable length data from the result of a call to H5.h5d_readVL. Note that the type that should be doing the reading is the member type, not the vlen type itself.
- Parameters:
rawBytes
- the result of reading a vlen type from a dataset byH5Dataset.readVlenElements(H5DataSpace, H5DataSpace, int)
viaH5.H5DreadVL(long, long, long, long, long, Object[])
. These bytes are the raw data representation of each selected element that was read.- Returns:
- a variable length number of elements of this type
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in classH5Object
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getDataSize
public long getDataSize()The size in bytes of any element of this type.
-