HDF-Java Products - PowerPoint PPT Presentation

About This Presentation
Title:

HDF-Java Products

Description:

a programming framework that allows Java code to call and be called by ... Pure Java Library. Pros: True platform independence ... – PowerPoint PPT presentation

Number of Views:13
Avg rating:3.0/5.0
Slides: 25
Provided by: xcao
Learn more at: http://www.hdfeos.org
Category:

less

Transcript and Presenter's Notes

Title: HDF-Java Products


1
HDF-Java Products
Peter Cao The HDF Group HDF and HDF-EOS Workshop
XII October 15, 2008
2
What are the HDF-Java products?
HDF-Java
HDF
Java Wrapper
Object Package
Viewer Editor
3
Java Wrapper
HDF
4
Java Wrapper
Pure Java Library
HDF
Java Native Interface
a programming framework that allows Java code to
call and be called by applications and libraries
written in other languages
HDF
5
Pure Java Library
  • Pros
  • True platform independence
  • Direct access to file (no data conversion between
    C and Java)

Pure Java Library
  • Cons
  • Substantial amount of work to implement
  • Hard to maintain (new features or format changes)

HDF
6
HDF JNI
  • Pros
  • Easy to implement
  • Easy to maintain

HDF
Java Native Interface
  • Cons
  • Requires data conversion between C and Java
  • HDF JNI is platform dependent

HDF
7
Java Wrapper
HDF
Java Native Interface
libjhdf.so (or dll)
libjhdf5.so (or dll)
HDFLibrary.java H5.java
HDF4 library
HDF5 library
8
Java Wrapper C versus Java
hid_t H5Fcreate ( const char name, unsigned
flags, hid_t create_id, hid_t access_id
) hid_t H5Fopen ( const char name, unsigned
flags, hid_t access_id ) herr_t H5Fclose
( hid_t file_id )
public static native int H5Fcreate ( String
name, int flags, int create_id, int
access_id) public static native int H5Fopen
( String name, int flags, int
access_id) public static native int H5Fclose
( int file_id)
C
Java
9
Object Package
HDF-Java
HDF
Java Wrapper
Object Package
Viewer Editor
10
Java Wrapper simple dataset read
int fid, did, sid, tid, rank long
dims, maxDims Object theData fid
H5.H5Fopen( fname, HDF5Constants.H5F_ACC_RDWR,
HDF5Constants.H5P_DEFAULT) did
H5.H5Dopen(fid, dname) sid
H5.H5Dget_space(did) tid
H5.H5Dget_type(did) rank
H5.H5Sget_simple_extent_ndims(sid) dims
new longrank maxDims new longrank
H5.H5Sget_simple_extent_dims(sid, dims,
maxDims) theData allocateArray(tid,
dims) H5.H5Dread( did, tid,
HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
HDF5Constants.H5P_DEFAULT, theData)
H5.H5Sclose(sid) H5.H5Tclose(tid)
H5.H5Dclose(did) H5.H5Fclose(fid)
11
Object Package the easy way
theData Dataset.read()
12
Object Package main purposes
  • Simplifies access to HDF files
  • Separates applications from libraries
  • Modular design
  • Client server model
  • Makes testing and maintenance easy

13
Object Package levels of objects
Common Objects ncsa.hdf.object jhdfobj.jar
Abstract classes
HDF5 ncsa.hdf.object.h5 jhdf5obj.jar
HDF4 ncsa.hdf.object.h4 jhdf4obj.jar
Implementation
14
Object Package abstract classes
FileFormat
HObject
Dataset
Group
ScalarDS
CompoundDS
October 15-17, 2008
HDF and HDF-EOS Workshop XII
14
15
Object Package HDF4 implementation
ScalarDS
CompounDS
Group
H4Vdata
H4Group
H4GRImage
H4SDS
H4File
FileFormat
October 15-17, 2008
HDF and HDF-EOS Workshop XII
15
16
Object Package HDF5 implementation
ScalarDS
CompounDS
Group
H5Group
H5ScalarDS
H5CompoundDS
H5File
FileFormat
October 15-17, 2008
HDF and HDF-EOS Workshop XII
16
17
Object Package file create
import ncsa.hdf.object. public class
H5FileCreate private static String fname
"H5FileCreate.h5" public static void main(
String args ) throws Exception
FileFormat fileFormat FileFormat.getFileFormat(F
ileFormat.FILE_TYPE_HDF5)
fileFormat.createFile(fname, FileFormat.FILE_CREAT
E)
18
HDFView
HDF-Java
HDF
Java Wrapper
Object Package
Viewer Editor
19
HDFView basic components
20
HDFView GUI components
HDFView (GUI)
MetaDataView
TreeView
UserImp
UserImp
TableView
TextView
ImageView
UserImp
UserImp
UserImp
21
HDFView all together
22
What are the HDF-Java products?
HDF-Java
HDF
Java Wrapper
Object Package
Viewer Editor
23
Thank You!
This report is based upon work supported in part
by a Cooperative Agreement with the National
Aeronautics and Space Administration (NASA) under
NASA Awards NNX06AC83A and NNX08AO77A. Any
opinions, findings, and conclusions or
recommendations expressed in this material are
those of the author(s) and do not necessarily
reflect the views of the National Aeronautics and
Space Administration.
24
Questions/comments?
Write a Comment
User Comments (0)
About PowerShow.com