Ejemplo n.º 1
0
  private void init(final H5Group h5Group) {
    shortName = h5Group.getName();
    originalName = getName();

    List<HObject> members = h5Group.getMemberList();
    if (members != null) {
      for (HObject hObject : members) {
        if (hObject instanceof H5ScalarDS) {
          H5ScalarDS scalarDS = (H5ScalarDS) hObject;
          HdfDataItem dataItem = new HdfDataItem(factoryName, dataset.getH5File(), this, scalarDS);
          itemMap.put(scalarDS.getName(), dataItem);
        }
        if (hObject instanceof H5Group) {
          H5Group group = (H5Group) hObject;
          HdfGroup hdfGroup = new HdfGroup(factoryName, group, this, dataset);
          groupMap.put(group.getName(), hdfGroup);
        }
      }

      try {
        @SuppressWarnings("unchecked")
        List<Metadata> metadatas = h5Group.getMetadata();

        for (Metadata metadata : metadatas) {
          if (metadata instanceof Attribute) {
            Attribute attribute = (Attribute) metadata;
            HdfAttribute hdfAttr = new HdfAttribute(factoryName, attribute);
            attributeMap.put(hdfAttr.getName(), hdfAttr);
          }
        }
      } catch (HDF5Exception e) {
        Factory.getLogger().severe(e.getMessage());
      }
    }
  }
Ejemplo n.º 2
0
 /** Closes the HDF5 file. Function usefull only because of the try/catch */
 public static void hdf5_close(H5File h5) {
   try {
     h5.close();
   } catch (HDF5Exception ex) {
     System.out.println("Could not close HDF5 file?");
     ex.printStackTrace();
   }
 }
Ejemplo n.º 3
0
 private String createErrorMessage(HDF5Exception e) {
   return "HDF library error: " + e.getMessage();
 }