|
||||||||||
| 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.fits.FitsDatatype
public class FitsDatatype
Datatype encapsulates information of a datatype. Information includes the class, size, endian of a datatype.
| Field Summary | |
|---|---|
static long |
serialVersionUID
|
| 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, NATIVE, NSGN, ORDER_BE, ORDER_LE, ORDER_NONE, ORDER_VAX, SIGN_2, SIGN_NONE |
| Fields inherited from class ncsa.hdf.object.HObject |
|---|
separator |
| Constructor Summary | |
|---|---|
FitsDatatype(int theType)
Create a Datatype with a given fits native datatype. |
|
FitsDatatype(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 dtype,
int size)
Allocate an one-dimensional array of byte, short, int, long, float, double, or String to store data retrieved from an fits file based on the given fits datatype and dimension sizes. |
void |
close(int id)
Closes a datatype identifier. |
void |
fromNative()
Translate fits datatype identifier into FitsDatatype. |
void |
fromNative(int dtype)
Translate fits datatype identifier into FitsDatatype. |
java.lang.String |
getDatatypeDescription()
Returns a short text description of this datatype. |
java.util.List |
getMetadata(int... attrPropList)
|
boolean |
hasAttribute()
Check if the object has any attributes attached. |
boolean |
isUnsigned()
Checks if this datatype is an unsigned integer. |
int |
toNative()
Converts the datatype object to a native datatype. |
| Methods inherited from class ncsa.hdf.object.Datatype |
|---|
getBasetype, getDatatypeClass, getDatatypeOrder, getDatatypeSign, getDatatypeSize, getEnumMembers, getMetadata, open, removeMetadata, setEnumMembers, writeMetadata |
| Methods inherited from class ncsa.hdf.object.HObject |
|---|
equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, setLinkTargetObjName, setName, setPath, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long serialVersionUID
| Constructor Detail |
|---|
public FitsDatatype(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 FitsDatatype(int theType)
theType - the fits native datatype.| Method Detail |
|---|
public boolean hasAttribute()
DataFormat
public static java.lang.Object allocateArray(int dtype,
int size)
throws java.lang.OutOfMemoryError
dtype - the fits datatype.size - the total size of the array.
java.lang.OutOfMemoryErrorpublic void fromNative()
public void fromNative(int dtype)
fromNative in class DatatypenativeID - the fits native datatype.public java.lang.String getDatatypeDescription()
Datatype
getDatatypeDescription in class Datatypepublic boolean isUnsigned()
Datatype
isUnsigned in class Datatypepublic int toNative()
Datatype
For example, a HDF5 datatype created from
H5Dataype dtype = new H5Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE); int tid = dtype.toNative();There "tid" will be the HDF5 datatype id of a 32-bit unsigned integer, which is equivalent to
int tid = H5.H5Tcopy(HDF5Constants.H5T_NATIVE_UNINT32);
toNative in class Datatypepublic void close(int id)
DatatypeSub-clases must replace this default implementation.
close in class Datatypeid - the datatype identifier to close.
public java.util.List getMetadata(int... attrPropList)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||