Class Array

All Implemented Interfaces:
Node
Direct Known Subclasses:
Array, Array

public abstract class Array extends AbstractNode
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected CodecPipeline
     

    Fields inherited from class dev.zarr.zarrjava.core.AbstractNode

    storeHandle

    Fields inherited from interface dev.zarr.zarrjava.core.Node

    ZARR_JSON, ZARRAY, ZGROUP
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Array(StoreHandle storeHandle)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    abstract ArrayMetadata
     
    static Array
    open(StoreHandle storeHandle)
    Opens an existing Zarr array at a specified storage location.
    static Array
    open(String path)
    Opens an existing Zarr array at a specified storage location.
    static Array
    open(Path path)
    Opens an existing Zarr array at a specified storage location.
    ucar.ma2.Array
    Reads the entire Zarr array into an ucar.ma2.Array.
    ucar.ma2.Array
    read(boolean parallel)
    Reads the entire Zarr array into an ucar.ma2.Array.
    ucar.ma2.Array
    read(long[] offset, int[] shape)
    Reads a part of the Zarr array based on a requested offset and shape into an ucar.ma2.Array.
    ucar.ma2.Array
    read(long[] offset, int[] shape, boolean parallel)
    Reads a part of the Zarr array based on a requested offset and shape into an ucar.ma2.Array.
    ucar.ma2.Array
    readChunk(long[] chunkCoords)
    Reads one chunk of the Zarr array as specified by the chunk coordinates into an ucar.ma2.Array.
    void
    write(long[] offset, ucar.ma2.Array array)
    Writes a ucar.ma2.Array into the Zarr array at a specified offset.
    void
    write(long[] offset, ucar.ma2.Array array, boolean parallel)
    Writes a ucar.ma2.Array into the Zarr array at a specified offset.
    void
    write(ucar.ma2.Array array)
    Writes a ucar.ma2.Array into the Zarr array at the beginning of the Zarr array.
    void
    write(ucar.ma2.Array array, boolean parallel)
    Writes a ucar.ma2.Array into the Zarr array at the beginning of the Zarr array.
    void
    writeChunk(long[] chunkCoords, ucar.ma2.Array chunkArray)
    Writes one chunk into the Zarr array as specified by the chunk coordinates.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • metadata

      public abstract ArrayMetadata metadata()
    • open

      public static Array open(StoreHandle storeHandle) throws IOException, ZarrException
      Opens an existing Zarr array at a specified storage location. Automatically detects the Zarr version.
      Parameters:
      storeHandle - the storage location of the Zarr array
      Throws:
      IOException - throws IOException if the metadata cannot be read
      ZarrException - throws ZarrException if the Zarr array cannot be opened
    • open

      public static Array open(Path path) throws IOException, ZarrException
      Opens an existing Zarr array at a specified storage location. Automatically detects the Zarr version.
      Parameters:
      path - the storage location of the Zarr array
      Throws:
      IOException - throws IOException if the metadata cannot be read
      ZarrException - throws ZarrException if the Zarr array cannot be opened
    • open

      public static Array open(String path) throws IOException, ZarrException
      Opens an existing Zarr array at a specified storage location. Automatically detects the Zarr version.
      Parameters:
      path - the storage location of the Zarr array
      Throws:
      IOException - throws IOException if the metadata cannot be read
      ZarrException - throws ZarrException if the Zarr array cannot be opened
    • write

      public void write(long[] offset, ucar.ma2.Array array, boolean parallel)
      Writes a ucar.ma2.Array into the Zarr array at a specified offset. The shape of the Zarr array needs be large enough for the write.
      Parameters:
      offset - the offset where to write the data
      array - the data to write
      parallel - utilizes parallelism if true
    • writeChunk

      public void writeChunk(long[] chunkCoords, ucar.ma2.Array chunkArray) throws ZarrException
      Writes one chunk into the Zarr array as specified by the chunk coordinates. The shape of the Zarr array needs to be large enough to write.
      Parameters:
      chunkCoords - The coordinates of the chunk as computed by the offset of the chunk divided by the chunk shape.
      chunkArray - The data to write into the chunk
      Throws:
      ZarrException - throws ZarrException if the write fails
    • readChunk

      @Nonnull public ucar.ma2.Array readChunk(long[] chunkCoords) throws ZarrException
      Reads one chunk of the Zarr array as specified by the chunk coordinates into an ucar.ma2.Array.
      Parameters:
      chunkCoords - The coordinates of the chunk as computed by the offset of the chunk divided by the chunk shape.
      Throws:
      ZarrException - throws ZarrException if the requested chunk is outside the array's domain or if the read fails
    • write

      public void write(ucar.ma2.Array array)
      Writes a ucar.ma2.Array into the Zarr array at the beginning of the Zarr array. The shape of the Zarr array needs be large enough for the write. Utilizes no parallelism.
      Parameters:
      array - the data to write
    • write

      public void write(long[] offset, ucar.ma2.Array array)
      Writes a ucar.ma2.Array into the Zarr array at a specified offset. The shape of the Zarr array needs be large enough for the write. Utilizes no parallelism.
      Parameters:
      offset - the offset where to write the data
      array - the data to write
    • write

      public void write(ucar.ma2.Array array, boolean parallel)
      Writes a ucar.ma2.Array into the Zarr array at the beginning of the Zarr array. The shape of the Zarr array needs be large enough for the write.
      Parameters:
      array - the data to write
      parallel - utilizes parallelism if true
    • read

      @Nonnull public ucar.ma2.Array read() throws ZarrException
      Reads the entire Zarr array into an ucar.ma2.Array. Utilizes no parallelism.
      Throws:
      ZarrException - throws ZarrException if the read fails
    • read

      @Nonnull public ucar.ma2.Array read(long[] offset, int[] shape) throws ZarrException
      Reads a part of the Zarr array based on a requested offset and shape into an ucar.ma2.Array. Utilizes no parallelism.
      Parameters:
      offset - the offset where to start reading
      shape - the shape of the data to read
      Throws:
      ZarrException - throws ZarrException if the requested data is outside the array's domain or if the read fails
    • read

      @Nonnull public ucar.ma2.Array read(boolean parallel) throws ZarrException
      Reads the entire Zarr array into an ucar.ma2.Array.
      Parameters:
      parallel - utilizes parallelism if true
      Throws:
      ZarrException - throws ZarrException if the requested data is outside the array's domain or if the read fails
    • read

      @Nonnull public ucar.ma2.Array read(long[] offset, int[] shape, boolean parallel) throws ZarrException
      Reads a part of the Zarr array based on a requested offset and shape into an ucar.ma2.Array.
      Parameters:
      offset - the offset where to start reading
      shape - the shape of the data to read
      parallel - utilizes parallelism if true
      Throws:
      ZarrException - throws ZarrException if the requested data is outside the array's domain or if the read fails
    • access

      public Array.ArrayAccessor access()