|
||||||||||
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.h4.H4Datatype
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 | |
H4Datatype(int nativeID)
Create a Datatype with a given HDF native datatype. |
|
H4Datatype(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 datatype,
int datasize)
Allocate a 1D array large enough to hold a multidimensional array of 'datasize' elements of 'datatype' numbers. |
void |
fromNative(int tid)
Specify this datatype with a given id of a user defined datatype. |
java.lang.String |
getDatatypeDescription()
Returns a short text description of this datatype. |
static java.lang.String |
getDatatypeDescription(int datatype)
Returns the short description of a given datatype. |
boolean |
isUnsigned()
Checks if this datatype is an unsigned integer. |
static boolean |
isUnsigned(int datatype)
Checks if the datatype is an unsigned integer. |
int |
toNative()
Converts this datatype to a user defined datatype. |
Methods inherited from class ncsa.hdf.object.Datatype |
close, getDatatypeClass, getDatatypeOrder, getDatatypeSign, getDatatypeSize, getMetadata, open, removeMetadata, writeMetadata |
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 H4Datatype(int tclass, int tsize, int torder, int tsign)
tclass
- the class of the datatype.tsize
- the size of the datatype.torder
- the order of the datatype.tsign
- the sign of the datatype.public H4Datatype(int nativeID)
nativeID
- the hdf native datatype.Method Detail |
public void fromNative(int tid)
Datatype
For example, if the type identifier is a 32-bit unsigned integer created from HDF5,
int user_type = H5.J2C( HDF5CDataTypes.JH5T_NATIVE_UNINT32); Datatype dtype = new Datatype(user_type);will construct a datatype equivalent to new Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE);
fromNative
in class Datatype
tid
- the identifier of user defined datatype.public static final java.lang.Object allocateArray(int datatype, int datasize) throws java.lang.OutOfMemoryError
datatype
- the data typedatasize
- the size of the data array
java.lang.OutOfMemoryError
public java.lang.String getDatatypeDescription()
Datatype
getDatatypeDescription
in class Datatype
public static final java.lang.String getDatatypeDescription(int datatype)
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |