HDF Object Package

Download       Use and Examples

The design and class hierarchy of the HDF Object Package are described in this document. Refer to Use and Examples for information on using the package.


Overview

The HDF Object Package is a Java package that provides an object-oriented interface to HDF data objects. The package offers a common API to access both HDF4 and HDF5 files.

The HDF Object Package does not provide a one-to-one mapping from Java methods to routines in the standard HDF4 and HDF5 libraries. The one-to-one mappings are provided via the HDF Java Native Interface products Java HDF Interface (JHI) and Java HDF5 Interface (JHI5). The HDF Object Package wraps these direct mappings with a higher level object model.

The HDF Object Package, hdf.object, provides classes that reflect the fundamental objects of the two HDF formats. Fundamental objects from HDF4 (group, multi-dimensional array, raster image, vdata, and annotation) and HDF5 (group and dataset) are presented as Java classes in the HDF Object Package.

There are three major advantages offered by the HDF Object Package:


The Object Package

The following diagram explains the structure of the HDF object package and how to use it. Package hdf.object contains the common object/interface. This package only defines interfaces or abstract classes for accessing HDF files. The implementation will rely on the HDF4/HDF5 object package. Application classes should only include hdf.object.

The hdf.object.h4 is an implementation of the HDF4 objects. It implements the interfaces and abstract classes defined in the hdf.object package. The HDF4 object package requires the HDF4 Java Native Interface (hdf.hdflib). Applications should not include this package so that it compiles and runs without the HDF4 library.

The hdf.object.h5 is an implementation of the HDF5 objects. It implements the interfaces and abstract classes defined in the hdf.object package. The HDF5 object package requires the HDF5 Java Native Interface (hdf.hdf5lib). Applications should not include this package so that it compiles and runs without the HDF5 library.


Figure 1. The Object Package.


The class hierarchy

The HDF Object Package implements an abstract data model, and the objects of the HDF4 and HDF5 data models are represented as instances of the abstract objects. The abstract class HObject has two fundamental abstract classes are Group and Dataset, and all HDF5 and HDF4 objects are a sub-type of one of these abstract classes.

Figure 1 shows the class hierarchy of the HDF Object Package.

The classes are explained in the Java class document (Java Docs).


Figure 2. The Class Hierarchy of HDF Objects.


Limitations

The current version of the HDF Object Package has the following limitations:

To Obtain

The HDF Object Package is freely available, as a full source release. Compiled jar files are available, and compiled native libraries are available for selected platforms.

Prerequisites

The HDF Object Package requires the Java HDF Interface (JHI) and the Java HDF5 Interface (JHI5). These are included in the distribution.

The HDF Object Package was developed using Java 6 SDK (JDK 1.6.x and JDK 1.7.x). The HDF Object Package has no platform specific code, and should work on any system with Java JDK 1.6.x or JDK 1.7.x. At the time of the release, the code has been tested on Solaris, Linux, OS X, and Windows 7/8.


Download

The source and pre-built binaries for the HDF Object Package can be downloaded from:
http://www.hdfgroup.org/products/java/release/download.html
Binary release

The binary release includes jar files for the HDF Object Package, the JHI (HDF4 library interface) and JHI5 (HDF5 library interface). The native libraries are available for selected platforms.

lib/jhdf.jar The Java HDF Interface, accesses the native HDF4 library
lib/jhdf5.jar The Java HDF5 Interface, accesses the native HDF5 library
lib/jhdfobj.jar The hdf.object package
lib/jhdf4obj.jar The hdf.object.h4 package
lib/jhdf5obj.jar The hdf.object.h5 package
lib/ Solaris, OS X or Linux
libjhdf.so The native HDF4 library and JNI implementation (called by jhdf.jar)
libjhdf5.so The native HDF5 library and JNI implementation (called by jhdf5.jar)
bin/ Windows
jhdf.dll The native HDF4 library and JNI implementation (called by jhdf.jar)
jhdf5.dll The native HDF5 library and JNI implementation (called by jhdf5.jar)

Source

The source distribution includes all the Java source to build the jar files, plus the C source for the native methods of the JHI and JHI5.

The JHI requires the HDF4 library (binary) and the JHI5 requires the HDF5 library (binary). These are not included in the Java source.

Building the HDF Java Products from the source distribution is an easy endeavor. There are CMake specialized compressed sources for all the required libraries. Refer to the following instructions for more details: