diff options
Diffstat (limited to 'java/examples/groups/H5Ex_G_Visit.java')
-rw-r--r-- | java/examples/groups/H5Ex_G_Visit.java | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/java/examples/groups/H5Ex_G_Visit.java b/java/examples/groups/H5Ex_G_Visit.java index f91c707..790be80 100644 --- a/java/examples/groups/H5Ex_G_Visit.java +++ b/java/examples/groups/H5Ex_G_Visit.java @@ -1,12 +1,11 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Copyright by The HDF Group. * - * Copyright by the Board of Trustees of the University of Illinois. * * All rights reserved. * * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * * the COPYING file, which can be found at the root of the source code * - * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * distribution tree, or in https://www.hdfgroup.org/licenses. * * If you do not have access to either file, you may request a copy from * * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -23,10 +22,10 @@ package examples.groups; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; -import hdf.hdf5lib.callbacks.H5L_iterate_cb; import hdf.hdf5lib.callbacks.H5L_iterate_t; -import hdf.hdf5lib.callbacks.H5O_iterate_cb; +import hdf.hdf5lib.callbacks.H5L_iterate_opdata_t; import hdf.hdf5lib.callbacks.H5O_iterate_t; +import hdf.hdf5lib.callbacks.H5O_iterate_opdata_t; import hdf.hdf5lib.structs.H5L_info_t; import hdf.hdf5lib.structs.H5O_info_t; @@ -47,7 +46,7 @@ public class H5Ex_G_Visit { private void VisitGroup() throws Exception { - long file_id = -1; + long file_id = HDF5Constants.H5I_INVALID_HID; try { // Open file @@ -55,13 +54,13 @@ public class H5Ex_G_Visit { // Begin iteration using H5Ovisit System.out.println("Objects in the file:"); - H5O_iterate_t iter_data = new H5O_iter_data(); - H5O_iterate_cb iter_cb = new H5O_iter_callback(); + H5O_iterate_opdata_t iter_data = new H5O_iter_data(); + H5O_iterate_t iter_cb = new H5O_iter_callback(); H5.H5Ovisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb, iter_data); System.out.println(); // Repeat the same process using H5Lvisit - H5L_iterate_t iter_data2 = new H5L_iter_data(); - H5L_iterate_cb iter_cb2 = new H5L_iter_callback(); + H5L_iterate_opdata_t iter_data2 = new H5L_iter_data(); + H5L_iterate_t iter_cb2 = new H5L_iter_callback(); System.out.println("Links in the file:"); H5.H5Lvisit(file_id, HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_NATIVE, iter_cb2, iter_data2); @@ -91,12 +90,12 @@ public class H5Ex_G_Visit { } } - private class H5L_iter_data implements H5L_iterate_t { + private class H5L_iter_data implements H5L_iterate_opdata_t { public ArrayList<idata> iterdata = new ArrayList<idata>(); } - private class H5L_iter_callback implements H5L_iterate_cb { - public int callback(long group, String name, H5L_info_t info, H5L_iterate_t op_data) { + private class H5L_iter_callback implements H5L_iterate_t { + public int callback(long group, String name, H5L_info_t info, H5L_iterate_opdata_t op_data) { idata id = new idata(name, info.type); ((H5L_iter_data) op_data).iterdata.add(id); @@ -107,8 +106,8 @@ public class H5Ex_G_Visit { // Get type of the object and display its name and type. The name of the object is passed to this // function by the Library. infobuf = H5.H5Oget_info_by_name(group, name, HDF5Constants.H5P_DEFAULT); - H5O_iterate_cb iter_cbO = new H5O_iter_callback(); - H5O_iterate_t iter_dataO = new H5O_iter_data(); + H5O_iterate_t iter_cbO = new H5O_iter_callback(); + H5O_iterate_opdata_t iter_dataO = new H5O_iter_data(); ret = iter_cbO.callback(group, name, infobuf, iter_dataO); } catch (Exception e) { @@ -119,12 +118,12 @@ public class H5Ex_G_Visit { } } - private class H5O_iter_data implements H5O_iterate_t { + private class H5O_iter_data implements H5O_iterate_opdata_t { public ArrayList<idata> iterdata = new ArrayList<idata>(); } - private class H5O_iter_callback implements H5O_iterate_cb { - public int callback(long group, String name, H5O_info_t info, H5O_iterate_t op_data) { + private class H5O_iter_callback implements H5O_iterate_t { + public int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata_t op_data) { idata id = new idata(name, info.type); ((H5O_iter_data) op_data).iterdata.add(id); |