|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectncsa.hdf.object.HObject
ncsa.hdf.object.Datatype
ncsa.hdf.object.h5.H5Datatype
Datatype encapsulates information of a datatype. Information includes the class, size, endian of a datatype.
Field Summary |
Fields inherited from class ncsa.hdf.object.Datatype |
CLASS_ARRAY, CLASS_BITFIELD, CLASS_CHAR, CLASS_COMPOUND, CLASS_ENUM, CLASS_FLOAT, CLASS_INTEGER, CLASS_NO_CLASS, CLASS_OPAQUE, CLASS_REFERENCE, CLASS_STRING, CLASS_VLEN, datatypeClass, datatypeOrder, datatypeSign, datatypeSize, NATIVE, nativeID, NSGN, ORDER_BE, ORDER_LE, ORDER_NONE, ORDER_VAX, SIGN_2, SIGN_NONE |
Fields inherited from class ncsa.hdf.object.HObject |
hasAttribute, oid, separator |
Constructor Summary | |
H5Datatype(FileFormat fileFormat,
java.lang.String name,
java.lang.String path,
long[] oid)
Constructs a named H5Datatype object with specific name and path. |
|
H5Datatype(int nativeID)
Create a Datatype with a given HDF native datatype. |
|
H5Datatype(int tclass,
int tsize,
int torder,
int tsign)
Create an Datatype with specified class, size, byte order and sign. |
Method Summary | |
static java.lang.Object |
allocateArray(int tid,
int size)
Allocate an one-dimensional array of byte, short, int, long, float, double, or String to store data retrieved from an HDF5 file based on the given HDF5 datatype and dimension sizes. |
void |
close(int tid)
Closes access to this object. |
void |
fromNative(int tid)
Translate HDF5 datatype identifier into H5Datatype. |
java.lang.String |
getDatatypeDescription()
Returns a short text description of this datatype. |
static java.lang.String |
getDatatypeDescription(int tid)
Returns the short description of a given datatype. |
static int |
getDatatypeSize(int tid)
Returns the size of this datatype in bytes. |
java.util.List |
getMetadata()
Loads the metadata such as attributes and type of the the data object into memory if the metadata is not loaded. |
boolean |
isUnsigned()
Checks if this datatype is an unsigned integer. |
static boolean |
isUnsigned(int datatype)
Checks if the datatype is an unsigned integer. |
int |
open()
Opens access to this object. |
void |
removeMetadata(java.lang.Object info)
Deletes an existing metadata from this data object. |
int |
toNative()
Converts this datatype to a user defined datatype. |
static int |
toNative(int tid)
Return the HDF5 native datatype based on the HDF5 datatype on disk For example, a HDF5 datatype created from |
void |
writeMetadata(java.lang.Object info)
Saves a specific metadata into file. |
Methods inherited from class ncsa.hdf.object.Datatype |
getDatatypeClass, getDatatypeOrder, getDatatypeSign, getDatatypeSize |
Methods inherited from class ncsa.hdf.object.HObject |
equalsOID, getFID, getFile, getFileFormat, getName, getOID, getPath, hasAttribute, setName, setPath, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public H5Datatype(FileFormat fileFormat, java.lang.String name, java.lang.String path, long[] oid)
fileFormat
- the HDF file.name
- the name of this H5Datatype.path
- the full path of this H5Datatype.oid
- the unique identifier of this H5Datatype.public H5Datatype(int tclass, int tsize, int torder, int tsign)
tclass
- the class of the datatype.tsize
- the size of the datatype in bytes.torder
- the order of the datatype.tsign
- the sign of the datatype.public H5Datatype(int nativeID)
int user_type = H5.J2C( HDF5CDataTypes.JH5T_NATIVE_UNINT32); H5Datatype dtype = new H5atatype(user_type);which is equivalent to
H5Datatype dtype = new H5atatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE);
nativeID
- the hdf native datatype.Method Detail |
public void fromNative(int tid)
int user_type = H5.J2C( HDF5CDataTypes.JH5T_NATIVE_UNINT32); H5Datatype dtype = new H5atatype(user_type);which is equivalent to
H5Datatype dtype = new H5atatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE);
fromNative
in class Datatype
tid
- the identifier of user defined datatype.public static java.lang.Object allocateArray(int tid, int size) throws java.lang.OutOfMemoryError
tid
- the datatype.size
- the total size of the array.
java.lang.OutOfMemoryError
public static int toNative(int tid)
H5Dataype dtype = new H5Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE); int type = dtype.toNative();here "type" will be the HDF5 datatype id of a 32-bit unsigned integer, which is equivalent to
int type = H5.J2C( HDF5CDataTypes.JH5T_NATIVE_UNINT32);
tid
- the datatype on disk.
public static final int getDatatypeSize(int tid)
tid
- the data type.public java.lang.String getDatatypeDescription()
Datatype
getDatatypeDescription
in class Datatype
public static final java.lang.String getDatatypeDescription(int tid)
public boolean isUnsigned()
Datatype
isUnsigned
in class Datatype
public static final boolean isUnsigned(int datatype)
datatype
- the data type.
public int toNative()
Datatype
For example, a HDF5 datatype created from
H5Dataype dtype = new H5Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE); int type = dtype.toNative();here "type" will be the HDF5 datatype id of a 32-bit unsigned integer, which is equivalent to
int type = H5.J2C( HDF5CDataTypes.JH5T_NATIVE_UNINT32);
toNative
in class Datatype
public int open()
HObject
Sub-classes have to implement this interface so that different data objects have their own ways of how the data resources are opened.
open
in class Datatype
public void close(int tid)
HObject
close
in class Datatype
public java.util.List getMetadata() throws HDF5Exception
DataFormat
getMetadata
in interface DataFormat
getMetadata
in class Datatype
HDF5Exception
public void writeMetadata(java.lang.Object info) throws java.lang.Exception
DataFormat
writeMetadata
in interface DataFormat
writeMetadata
in class Datatype
java.lang.Exception
public void removeMetadata(java.lang.Object info) throws HDF5Exception
DataFormat
removeMetadata
in interface DataFormat
removeMetadata
in class Datatype
HDF5Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |