Class H5IntegerType
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
H5IntegerType
(long id) protected
H5IntegerType
(long id, boolean opaqueUnsignedLongs) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
intToBytes
(long value) boolean
As a performance optimisation, we can read a 64 bit unsigned long as a signed long, to avoid having to use BigIntegers.boolean
boolean
read
(ByteBuffer outBuf, int offset) void
setOpaqueUnsignedLongs
(boolean opaqueUnsignedLongs) As a performance optimisation, we can read a 64 bit unsigned long as a signed long, to avoid having to use BigIntegers.toString()
nz.org.riskscape.engine.types.Type
toType()
Methods inherited from class nz.org.riskscape.hdf5.types.H5Type
build, canEqual, close, equals, getClassName, getDataSize, hashCode, readVlen
Methods inherited from class nz.org.riskscape.hdf5.H5Object
getPointer
-
Constructor Details
-
H5IntegerType
protected H5IntegerType(long id, boolean opaqueUnsignedLongs) -
H5IntegerType
protected H5IntegerType(long id)
-
-
Method Details
-
isUnsigned
public boolean isUnsigned() -
intToBytes
public byte[] intToBytes(long value) -
read
- Specified by:
read
in classH5Type
- 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
H5Type.toType()
-
toString
-
toType
public nz.org.riskscape.engine.types.Type toType() -
isVariableLength
public boolean isVariableLength()- Specified by:
isVariableLength
in classH5Type
- 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
-
setOpaqueUnsignedLongs
public void setOpaqueUnsignedLongs(boolean opaqueUnsignedLongs) As a performance optimisation, we can read a 64 bit unsigned long as a signed long, to avoid having to use BigIntegers. As long as the data never exceeds
Long.MAX_VALUE
or not used as a number then this is safe to do an can give a massive speed up.Because this gives a potential loss of functionality, it is off by default.
Setting this mutates the type instance, so make sure you 'own' the data type before setting it.
-
isOpaqueUnsignedLongs
public boolean isOpaqueUnsignedLongs()As a performance optimisation, we can read a 64 bit unsigned long as a signed long, to avoid having to use BigIntegers. As long as the data never exceeds
Long.MAX_VALUE
or not used as a number then this is safe to do an can give a massive speed up.Because this gives a potential loss of functionality, it is off by default.
Setting this mutates the type instance, so make sure you 'own' the data type before setting it.
-