hdf.object

## Class Datatype

- Object
- - hdf.object.HObject
  - - hdf.object.Datatype

- All Implemented Interfaces:
    MetaDataContainer, Serializable
  Direct Known Subclasses:
    H4Datatype, H5Datatype

      public abstract class Datatype
      extends HObject
      implements MetaDataContainer

  Datatype is an abstract class that defines datatype characteristics and APIs for a data type.

  A datatype has four basic characteristics: class, size, byte order and sign. These characteristics are defined in the HDF5 User's Guide.

  These characteristics apply to all the sub-classes. The sub-classes may have different ways to describe a datatype. We here define the native datatype to the datatype used by the sub-class. For example, H5Datatype uses a datatype identifier (hid_t) to specify a datatype. NC2Datatype uses ucar.nc2.DataType object to describe its datatype. "Native" here is different from the "native" definition in the HDF5 library.

  Two functions, createNative() and fromNative(), are defined to convert the general characteristics to/from the native datatype. Sub-classes must implement these functions so that the conversion will be done correctly. The values of the CLASS member are not identical to HDF5 values for a datatype class.

  Version:
    1.1 9/4/2007
  Author:
    Peter X. Cao
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long[]` | `arrayDims` The dimensions of the ARRAY element of an ARRAY datatype.
    `protected Datatype` | `baseType` The base datatype of this datatype (null if this datatype is atomic).
    `static int` | `CLASS_ARRAY` See HDF5 User's Guide
    `static int` | `CLASS_BITFIELD` See HDF5 User's Guide
    `static int` | `CLASS_CHAR` See HDF5 User's Guide
    `static int` | `CLASS_COMPOUND` See HDF5 User's Guide
    `static int` | `CLASS_ENUM` See HDF5 User's Guide
    `static int` | `CLASS_FLOAT` See HDF5 User's Guide
    `static int` | `CLASS_INTEGER` See HDF5 User's Guide
    `static int` | `CLASS_NO_CLASS` See HDF5 User's Guide
    `static int` | `CLASS_OPAQUE` See HDF5 User's Guide
    `static int` | `CLASS_REFERENCE` See HDF5 User's Guide
    `static int` | `CLASS_STRING` See HDF5 User's Guide
    `static int` | `CLASS_TIME` See HDF5 User's Guide
    `static int` | `CLASS_VLEN` See HDF5 User's Guide
    `protected List<String>` | `compoundMemberNames` The list of names of members of a compound Datatype.
    `protected List<Long>` | `compoundMemberOffsets` The list of offsets of members of a compound Datatype.
    `protected List<Datatype>` | `compoundMemberTypes` The list of types of members of a compound Datatype.
    `protected int` | `datatypeClass` The class of the datatype.
    `protected String` | `datatypeDescription`
    `protected int` | `datatypeOrder` The byte order of the datatype.
    `protected int` | `datatypeSign` The sign of the datatype.
    `protected long` | `datatypeSize` The size (in bytes) of the datatype.
    `protected Map<String,String>` | `enumMembers` The (name, value) pairs of enum members.
    `protected boolean` | `is_variable_str`
    `protected boolean` | `is_VLEN` Determines whether this datatype is a variable-length type.
    `static int` | `NATIVE` The default definition for datatype size, order, and sign.
    `static int` | `NSGN` See HDF5 User's Guide
    `static int` | `ORDER_BE` See HDF5 User's Guide
    `static int` | `ORDER_LE` See HDF5 User's Guide
    `static int` | `ORDER_NONE` See HDF5 User's Guide
    `static int` | `ORDER_VAX` See HDF5 User's Guide
    `static int` | `SIGN_2` See HDF5 User's Guide
    `static int` | `SIGN_NONE` See HDF5 User's Guide

    - ### Fields inherited from class hdf.object.HObject

      `fileFormat, linkTargetObjName, oid, separator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Datatype(FileFormat theFile, String typeName, String typePath)` Constructs a named datatype with a given file, name and path.
    `Datatype(FileFormat theFile, String typeName, String typePath, long[] oid)` Deprecated. Not for public use in the future. Using `Datatype(FileFormat, String, String)`
    `Datatype(int tclass, int tsize, int torder, int tsign)` Constructs a Datatype with specified class, size, byte order and sign.
    `Datatype(int tclass, int tsize, int torder, int tsign, Datatype tbase)` Constructs a Datatype with specified class, size, byte order and sign.
    `Datatype(int tclass, int tsize, int torder, int tsign, Datatype tbase, Datatype pbase)` Constructs a Datatype with specified class, size, byte order and sign.
    `Datatype(long tid)` Constructs a Datatype with a given native datatype identifier.
    `Datatype(long tid, Datatype pbase)` Constructs a Datatype with a given native datatype identifier.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract void` | `close(long id)` Closes a datatype identifier.
    `abstract long` | `createNative()` Converts the datatype object to a native datatype.
    `abstract void` | `fromNative(long nativeID)` Set datatype characteristics (class, size, byte order and sign) from a given datatype identifier.
    `long[]` | `getArrayDims()` Returns the dimensions of an Array Datatype.
    `List<String>` | `getCompoundMemberNames()`
    `List<Datatype>` | `getCompoundMemberTypes()`
    `Datatype` | `getDatatypeBase()` Returns the datatype of the elements for this datatype.
    `int` | `getDatatypeClass()` Returns the class of the datatype.
    `int` | `getDatatypeOrder()` Returns the byte order of the datatype.
    `int` | `getDatatypeSign()` Returns the sign (SIGN_NONE, SIGN_2 or NSGN) of an integer datatype.
    `long` | `getDatatypeSize()` Returns the size of the datatype in bytes.
    `String` | `getDescription()` Returns a short text description of this datatype.
    `Map<String,String>` | `getEnumMembers()` Returns the Map<String,String> pairs of enum members for enum datatype.
    `String` | `getEnumMembersAsString()` Returns the HashMap pairs of enum members for enum datatype.
    `List` | `getMetadata()` Retrieves the object's metadata, such as attributes, from the file.
    `boolean` | `isArray()` Checks if this datatype is an array type.
    `boolean` | `isBitField()` Checks if this datatype is a bitfield type.
    `boolean` | `isChar()` Checks if this datatype is a character type.
    `boolean` | `isCompound()` Checks if this datatype is an compound type.
    `boolean` | `isEnum()` Checks if this datatype is a enum type.
    `boolean` | `isFloat()` Checks if this datatype is a floating-point type.
    `boolean` | `isInteger()` Checks if this datatype is an integer type.
    `boolean` | `isOpaque()` Checks if this datatype is a opaque type.
    `boolean` | `isRef()` Checks if this datatype is a reference type.
    `boolean` | `isString()` Checks if this datatype is a string type.
    `abstract boolean` | `isText()`
    `boolean` | `isUnsigned()` Checks if this datatype is unsigned.
    `boolean` | `isVarStr()` Checks if this datatype is a variable-length string type.
    `boolean` | `isVLEN()` Checks if this datatype is a variable-length type.
    `long` | `open()` Opens access to this named datatype.
    `void` | `removeMetadata(Object info)` Deletes an existing piece of metadata from this object.
    `void` | `setEnumMembers(String enumStr)` Sets the (name, value) pairs of enum members for enum datatype.
    `String` | `toString()` Returns the name of the object.
    `void` | `updateMetadata(Object info)` Updates an existing piece of metadata attached to this object.
    `void` | `writeMetadata(Object info)` Writes a specific piece of metadata (such as an attribute) into the file.

    - ### Methods inherited from class hdf.object.HObject

      `debug, equals, equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, setLinkTargetObjName, setName, setPath`

    - ### Methods inherited from class Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface hdf.object.MetaDataContainer

      `hasAttribute`

- - ### Field Detail

    - #### NATIVE

          public static final int NATIVE

      The default definition for datatype size, order, and sign.
      See Also:
        Constant Field Values

    - #### CLASS_NO_CLASS

          public static final int CLASS_NO_CLASS

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_INTEGER

          public static final int CLASS_INTEGER

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_FLOAT

          public static final int CLASS_FLOAT

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_CHAR

          public static final int CLASS_CHAR

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_STRING

          public static final int CLASS_STRING

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_BITFIELD

          public static final int CLASS_BITFIELD

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_OPAQUE

          public static final int CLASS_OPAQUE

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_COMPOUND

          public static final int CLASS_COMPOUND

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_REFERENCE

          public static final int CLASS_REFERENCE

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_ENUM

          public static final int CLASS_ENUM

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_VLEN

          public static final int CLASS_VLEN

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_ARRAY

          public static final int CLASS_ARRAY

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### CLASS_TIME

          public static final int CLASS_TIME

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### ORDER_LE

          public static final int ORDER_LE

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### ORDER_BE

          public static final int ORDER_BE

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### ORDER_VAX

          public static final int ORDER_VAX

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### ORDER_NONE

          public static final int ORDER_NONE

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### SIGN_NONE

          public static final int SIGN_NONE

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### SIGN_2

          public static final int SIGN_2

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### NSGN

          public static final int NSGN

      See HDF5 User's Guide
      See Also:
        Constant Field Values

    - #### datatypeDescription

          protected String datatypeDescription

    - #### datatypeClass

          protected int datatypeClass

      The class of the datatype.

    - #### datatypeSize

          protected long datatypeSize

      The size (in bytes) of the datatype.

    - #### datatypeOrder

          protected int datatypeOrder

      The byte order of the datatype. Valid values are ORDER_LE, ORDER_BE, and ORDER_VAX.

    - #### datatypeSign

          protected int datatypeSign

      The sign of the datatype.

    - #### baseType

          protected Datatype baseType

      The base datatype of this datatype (null if this datatype is atomic).

    - #### arrayDims

          protected long[] arrayDims

      The dimensions of the ARRAY element of an ARRAY datatype.

    - #### is_VLEN

          protected boolean is_VLEN

      Determines whether this datatype is a variable-length type.

    - #### is_variable_str

          protected boolean is_variable_str

    - #### enumMembers

          protected Map<String,String> enumMembers

      The (name, value) pairs of enum members.

    - #### compoundMemberNames

          protected List<String> compoundMemberNames

      The list of names of members of a compound Datatype.

    - #### compoundMemberTypes

          protected List<Datatype> compoundMemberTypes

      The list of types of members of a compound Datatype.

    - #### compoundMemberOffsets

          protected List<Long> compoundMemberOffsets

      The list of offsets of members of a compound Datatype.

  - ### Constructor Detail

    - #### Datatype

          public Datatype(FileFormat theFile,
                          String typeName,
                          String typePath)

      Constructs a named datatype with a given file, name and path.
      Parameters:
        `theFile` - the HDF file.
        `typeName` - the name of the datatype, e.g "12-bit Integer".
        `typePath` - the full group path of the datatype, e.g. "/datatypes/".

    - #### Datatype

          @Deprecated
          public Datatype(FileFormat theFile,
                                      String typeName,
                                      String typePath,
                                      long[] oid)

      Deprecated. Not for public use in the future.
      Using `Datatype(FileFormat, String, String)`
      Parameters:
        `theFile` - the HDF file.
        `typeName` - the name of the datatype, e.g "12-bit Integer".
        `typePath` - the full group path of the datatype, e.g. "/datatypes/".
        `oid` - the oidof the datatype.

    - #### Datatype

          public Datatype(int tclass,
                          int tsize,
                          int torder,
                          int tsign)

      Constructs a Datatype with specified class, size, byte order and sign.

      The following is a list of a few example of H5Datatype.

      1. to create unsigned native integer
         H5Datatype type = new H5Dataype(CLASS_INTEGER, NATIVE, NATIVE, SIGN_NONE);
      2. to create 16-bit signed integer with big endian
         H5Datatype type = new H5Dataype(CLASS_INTEGER, 2, ORDER_BE, NATIVE);
      3. to create native float
         H5Datatype type = new H5Dataype(CLASS_FLOAT, NATIVE, NATIVE, -1);
      4. to create 64-bit double
         H5Datatype type = new H5Dataype(CLASS_FLOAT, 8, NATIVE, -1);
      Parameters:
        `tclass` - the class of the datatype, e.g. CLASS_INTEGER, CLASS_FLOAT and etc.
        `tsize` - the size of the datatype in bytes, e.g. for a 32-bit integer, the size is 4.
        `torder` - the byte order of the datatype. Valid values are ORDER_LE, ORDER_BE, ORDER_VAX and ORDER_NONE
        `tsign` - the sign of the datatype. Valid values are SIGN_NONE, SIGN_2 and MSGN

    - #### Datatype

          public Datatype(int tclass,
                          int tsize,
                          int torder,
                          int tsign,
                          Datatype tbase)

      Constructs a Datatype with specified class, size, byte order and sign.

      The following is a list of a few example of H5Datatype.

      1. to create unsigned native integer
         H5Datatype type = new H5Dataype(CLASS_INTEGER, NATIVE, NATIVE, SIGN_NONE);
      2. to create 16-bit signed integer with big endian
         H5Datatype type = new H5Dataype(CLASS_INTEGER, 2, ORDER_BE, NATIVE);
      3. to create native float
         H5Datatype type = new H5Dataype(CLASS_FLOAT, NATIVE, NATIVE, -1);
      4. to create 64-bit double
         H5Datatype type = new H5Dataype(CLASS_FLOAT, 8, NATIVE, -1);
      Parameters:
        `tclass` - the class of the datatype, e.g. CLASS_INTEGER, CLASS_FLOAT and etc.
        `tsize` - the size of the datatype in bytes, e.g. for a 32-bit integer, the size is 4.
        `torder` - the byte order of the datatype. Valid values are ORDER_LE, ORDER_BE, ORDER_VAX and ORDER_NONE
        `tsign` - the sign of the datatype. Valid values are SIGN_NONE, SIGN_2 and MSGN
        `tbase` - the base datatype of the new datatype

    - #### Datatype

          public Datatype(int tclass,
                          int tsize,
                          int torder,
                          int tsign,
                          Datatype tbase,
                          Datatype pbase)

      Constructs a Datatype with specified class, size, byte order and sign.

      The following is a list of a few example of H5Datatype.

      1. to create unsigned native integer
         H5Datatype type = new H5Dataype(CLASS_INTEGER, NATIVE, NATIVE, SIGN_NONE);
      2. to create 16-bit signed integer with big endian
         H5Datatype type = new H5Dataype(CLASS_INTEGER, 2, ORDER_BE, NATIVE);
      3. to create native float
         H5Datatype type = new H5Dataype(CLASS_FLOAT, NATIVE, NATIVE, -1);
      4. to create 64-bit double
         H5Datatype type = new H5Dataype(CLASS_FLOAT, 8, NATIVE, -1);
      Parameters:
        `tclass` - the class of the datatype, e.g. CLASS_INTEGER, CLASS_FLOAT and etc.
        `tsize` - the size of the datatype in bytes, e.g. for a 32-bit integer, the size is 4.
        `torder` - the byte order of the datatype. Valid values are ORDER_LE, ORDER_BE, ORDER_VAX and ORDER_NONE
        `tsign` - the sign of the datatype. Valid values are SIGN_NONE, SIGN_2 and MSGN
        `tbase` - the base datatype of the new datatype
        `pbase` - the parent datatype of the new datatype

    - #### Datatype

          public Datatype(long tid)

      Constructs a Datatype with a given native datatype identifier.

      For example, if the datatype identifier is a 32-bit unsigned integer created from HDF5,

           long tid = H5.H5Tcopy(HDF5Constants.H5T_NATIVE_UNINT32);
           Datatype dtype = new Datatype(tid);

      will construct a datatype equivalent to new Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE);
      Parameters:
        `tid` - the native datatype identifier.
      See Also:
        `fromNative(long tid)`

    - #### Datatype

          public Datatype(long tid,
                          Datatype pbase)

      Constructs a Datatype with a given native datatype identifier.

      For example, if the datatype identifier is a 32-bit unsigned integer created from HDF5,

           long tid = H5.H5Tcopy(HDF5Constants.H5T_NATIVE_UNINT32);
           Datatype dtype = new Datatype(tid);

      will construct a datatype equivalent to new Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE);
      Parameters:
        `tid` - the native datatype identifier.
        `pbase` - the parent datatype of the new datatype
      See Also:
        `fromNative(long tid)`

  - ### Method Detail

    - #### open

          public long open()

      Opens access to this named datatype. Sub-classes must replace this default implementation. For example, in H5Datatype, open() function H5.H5Topen(loc_id, name) to get the datatype identifier.
      Specified by:
        `open` in class `HObject`
      Returns:
        the datatype identifier if successful; otherwise returns negative value.
      See Also:
        `HObject.close(long)`

    - #### close

          public abstract void close(long id)

      Closes a datatype identifier.

      Sub-classes must replace this default implementation.

      Specified by:
        `close` in class `HObject`
      Parameters:
        `id` - the datatype identifier to close.

    - #### getDatatypeClass

          public int getDatatypeClass()

      Returns the class of the datatype. Valid values are:
      - CLASS_NO_CLASS
      - CLASS_INTEGER
      - CLASS_FLOAT
      - CLASS_CHAR
      - CLASS_STRING
      - CLASS_BITFIELD
      - CLASS_OPAQUE
      - CLASS_COMPOUND
      - CLASS_REFERENCE
      - CLASS_ENUM
      - CLASS_VLEN
      - CLASS_ARRAY
      Returns:
        the class of the datatype.

    - #### getDatatypeSize

          public long getDatatypeSize()

      Returns the size of the datatype in bytes. For example, for a 32-bit integer, the size is 4 (bytes).
      Returns:
        the size of the datatype.

    - #### getDatatypeOrder

          public int getDatatypeOrder()

      Returns the byte order of the datatype. Valid values are
      - ORDER_LE
      - ORDER_BE
      - ORDER_VAX
      - ORDER_NONE
      Returns:
        the byte order of the datatype.

    - #### getDatatypeSign

          public int getDatatypeSign()

      Returns the sign (SIGN_NONE, SIGN_2 or NSGN) of an integer datatype.
      Returns:
        the sign of the datatype.

    - #### getDatatypeBase

          public Datatype getDatatypeBase()

      Returns the datatype of the elements for this datatype.

      For example, in a dataset of type ARRAY of integer, the datatype of the dataset is ARRAY. The datatype of the base type is integer.

      Returns:
        the datatype of the contained datatype.

    - #### setEnumMembers

          public final void setEnumMembers(String enumStr)

      Sets the (name, value) pairs of enum members for enum datatype.

      For Example,

      setEnumMembers("lowTemp=-40, highTemp=90")
        sets the value of enum member lowTemp to -40 and highTemp to 90.
      setEnumMembers("lowTemp, highTemp")
        sets enum members to defaults, i.e. lowTemp=0 and highTemp=1
      setEnumMembers("lowTemp=10, highTemp")
        sets enum member lowTemp to 10 and highTemp to 11.
      Parameters:
        `enumStr` - the (name, value) pairs of enum members

    - #### getEnumMembers

          public final Map<String,String> getEnumMembers()

      Returns the Map<String,String> pairs of enum members for enum datatype.
      Returns:
        enumStr Map<String,String%gt; pairs of enum members

    - #### getEnumMembersAsString

          public final String getEnumMembersAsString()

      Returns the HashMap pairs of enum members for enum datatype.

      For Example,

      getEnumMembersAsString()
        returns "lowTemp=10, highTemp=40"
      Returns:
        enumStr the (name, value) pairs of enum members

    - #### getArrayDims

          public final long[] getArrayDims()

      Returns the dimensions of an Array Datatype.
      Returns:
        dims the dimensions of the Array Datatype

    - #### getCompoundMemberNames

          public final List<String> getCompoundMemberNames()

    - #### getCompoundMemberTypes

          public final List<Datatype> getCompoundMemberTypes()

    - #### createNative

          public abstract long createNative()

      Converts the datatype object to a native datatype. Subclasses must implement it so that this datatype will be converted accordingly. Use close() to close the native identifier; otherwise, the datatype will be left open.

      For example, a HDF5 datatype created from

           H5Dataype dtype = new H5Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE);
           int tid = dtype.createNative();

      The "tid" will be the HDF5 datatype id of a 64-bit unsigned integer, which is equivalent to

           int tid = H5.H5Tcopy(HDF5Constants.H5T_NATIVE_UNINT32);

      Returns:
        the identifier of the native datatype.

    - #### fromNative

          public abstract void fromNative(long nativeID)

      Set datatype characteristics (class, size, byte order and sign) from a given datatype identifier.

      Sub-classes must implement it so that this datatype will be converted accordingly.

      For example, if the type identifier is a 64-bit unsigned integer created from HDF5,

           H5Datatype dtype = new H5Datatype();
           dtype.fromNative(HDF5Constants.H5T_NATIVE_UNINT32);

      Where dtype is equivalent to
      new H5Datatype(CLASS_INTEGER, 4, NATIVE, SIGN_NONE);
      Parameters:
        `nativeID` - the datatype identifier.

    - #### getDescription

          public String getDescription()

      Returns a short text description of this datatype.
      Returns:
        a short text description of this datatype

    - #### isUnsigned

          public boolean isUnsigned()

      Checks if this datatype is unsigned.
      Returns:
        true if the datatype is unsigned; otherwise, returns false.

    - #### isText

          public abstract boolean isText()

    - #### isInteger

          public boolean isInteger()

      Checks if this datatype is an integer type.
      Returns:
        true if the datatype is integer; false otherwise

    - #### isFloat

          public boolean isFloat()

      Checks if this datatype is a floating-point type.
      Returns:
        true if the datatype is floating-point; false otherwise

    - #### isVarStr

          public boolean isVarStr()

      Checks if this datatype is a variable-length string type.
      Returns:
        true if the datatype is variable-length string; false otherwise

    - #### isVLEN

          public boolean isVLEN()

      Checks if this datatype is a variable-length type.
      Returns:
        true if the datatype is variable-length; false otherwise

    - #### isCompound

          public boolean isCompound()

      Checks if this datatype is an compound type.
      Returns:
        true if the datatype is compound; false otherwise

    - #### isArray

          public boolean isArray()

      Checks if this datatype is an array type.
      Returns:
        true if the datatype is array; false otherwise

    - #### isString

          public boolean isString()

      Checks if this datatype is a string type.
      Returns:
        true if the datatype is string; false otherwise

    - #### isChar

          public boolean isChar()

      Checks if this datatype is a character type.
      Returns:
        true if the datatype is character; false otherwise

    - #### isRef

          public boolean isRef()

      Checks if this datatype is a reference type.
      Returns:
        true if the datatype is reference; false otherwise

    - #### isEnum

          public boolean isEnum()

      Checks if this datatype is a enum type.
      Returns:
        true if the datatype is enum; false otherwise

    - #### isOpaque

          public boolean isOpaque()

      Checks if this datatype is a opaque type.
      Returns:
        true if the datatype is opaque; false otherwise

    - #### isBitField

          public boolean isBitField()

      Checks if this datatype is a bitfield type.
      Returns:
        true if the datatype is bitfield; false otherwise

    - #### getMetadata

          public List getMetadata()
                           throws Exception

      Description copied from interface: `MetaDataContainer`
      Retrieves the object's metadata, such as attributes, from the file.

      Metadata, such as attributes, is stored in a List.

      Specified by:
        `getMetadata` in interface `MetaDataContainer`
      Returns:
        the list of metadata objects.
      Throws:
        `Exception` - if the metadata can not be retrieved

    - #### writeMetadata

          public void writeMetadata(Object info)
                             throws Exception

      Description copied from interface: `MetaDataContainer`
      Writes a specific piece of metadata (such as an attribute) into the file. If an HDF(4&5) attribute exists in the file, this method updates its value. If the attribute does not exist in the file, it creates the attribute in the file and attaches it to the object. It will fail to write a new attribute to the object where an attribute with the same name already exists. To update the value of an existing attribute in the file, one needs to get the instance of the attribute by getMetadata(), change its values, then use writeMetadata() to write the value.
      Specified by:
        `writeMetadata` in interface `MetaDataContainer`
      Parameters:
        `info` - the metadata to write.
      Throws:
        `Exception` - if the metadata can not be written

    - #### removeMetadata

          public void removeMetadata(Object info)
                              throws Exception

      Description copied from interface: `MetaDataContainer`
      Deletes an existing piece of metadata from this object.
      Specified by:
        `removeMetadata` in interface `MetaDataContainer`
      Parameters:
        `info` - the metadata to delete.
      Throws:
        `Exception` - if the metadata can not be removed

    - #### updateMetadata

          public void updateMetadata(Object info)
                              throws Exception

      Description copied from interface: `MetaDataContainer`
      Updates an existing piece of metadata attached to this object.
      Specified by:
        `updateMetadata` in interface `MetaDataContainer`
      Parameters:
        `info` - the metadata to update.
      Throws:
        `Exception` - if the metadata can not be updated

    - #### toString

          public String toString()

      Description copied from class: `HObject`
      Returns the name of the object.

      This method overwrites the toString() method in the Java Object class (the root class of all Java objects) so that it returns the name of the HObject instead of the name of the class.

      For example, toString() returns "Raster Image #2" instead of "hdf.object.h4.H4SDS".

      Overrides:
        `toString` in class `HObject`
      Returns:
        The name of the object.

Copyright © 2018. All Rights Reserved.