Class H5File

java.lang.Object
nz.org.riskscape.hdf5.H5Object
nz.org.riskscape.hdf5.H5File
All Implemented Interfaces:
AutoCloseable

public class H5File extends H5Object

Gives access to datasets stored within an hdf5 file on the filesystem.

  • Constructor Details

    • H5File

      public H5File(Path path)
    • H5File

      public H5File(String filename)
  • Method Details

    • getRootGroup

      public H5Group getRootGroup()
      Returns:
      the root {@link H5Group. You are responsible for closing this group, maybe use acceptRootGroup or applyRootGroup for callback versions that close the group for you
    • applyRootGroup

      public <T> T applyRootGroup(Function<H5Group,T> callback)

      Convenience version of getRootGroup that handles closing the root group object for you. Applies a function to the root group, returning the result after closing the root group object

    • acceptRootGroup

      public void acceptRootGroup(Consumer<H5Group> callback)

      Convenience version of getRootGroup that handles closing the root group object for you. Applies a callback to the root group, closing the root group object once it has run

    • openObject

      public H5Object openObject(String path)
      Returns:
      either an H5Group or H5Dataset by its absolute path in this h5file
    • openDataset

      public H5Dataset openDataset(H5DatasetPath datasetId)
    • openDataset

      public H5Dataset openDataset(String groupPath, String datasetName)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in class H5Object