Package dev.zarr.zarrjava.v3
Class Array
java.lang.Object
dev.zarr.zarrjava.core.AbstractNode
dev.zarr.zarrjava.core.Array
dev.zarr.zarrjava.v3.Array
-
Nested Class Summary
Nested classes/interfaces inherited from class dev.zarr.zarrjava.core.Array
Array.ArrayAccessor -
Field Summary
Fields inherited from class dev.zarr.zarrjava.core.Array
codecPipelineFields inherited from class dev.zarr.zarrjava.core.AbstractNode
storeHandle -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedArray(StoreHandle storeHandle, ArrayMetadata arrayMetadata) -
Method Summary
Modifier and TypeMethodDescriptionstatic Arraycreate(StoreHandle storeHandle, ArrayMetadata arrayMetadata) Creates a new Zarr array with the provided metadata at a specified storage location.static Arraycreate(StoreHandle storeHandle, ArrayMetadata arrayMetadata, boolean existsOk) Creates a new Zarr array with the provided metadata at a specified storage location.static Arraycreate(StoreHandle storeHandle, Function<ArrayMetadataBuilder, ArrayMetadataBuilder> arrayMetadataBuilderMapper, boolean existsOk) Creates a new Zarr array at a specified storage location.static Arraycreate(String path, ArrayMetadata arrayMetadata) Creates a new Zarr array with the provided metadata at a specified storage location.static Arraycreate(String path, Function<ArrayMetadataBuilder, ArrayMetadataBuilder> arrayMetadataBuilderMapper, boolean existsOk) static Arraycreate(Path path, ArrayMetadata arrayMetadata) Creates a new Zarr array with the provided metadata at a specified storage location.static Arraycreate(Path path, Function<ArrayMetadataBuilder, ArrayMetadataBuilder> arrayMetadataBuilderMapper, boolean existsOk) metadata()static ArrayMetadataBuilderstatic ArrayMetadataBuildermetadataBuilder(ArrayMetadata existingMetadata) static Arrayopen(StoreHandle storeHandle) Opens an existing Zarr array at a specified storage location.static ArrayOpens an existing Zarr array at a specified storage location using a String path.static ArrayOpens an existing Zarr array at a specified storage location using a Path.resize(long[] newShape) Sets a new shape for the Zarr array.setAttributes(Map<String, Object> newAttributes) Sets the attributes of the Zarr array.toString()Updates the attributes of the Zarr array.
-
Constructor Details
-
Array
- Throws:
ZarrException
-
-
Method Details
-
metadata
-
open
Opens an existing Zarr array at a specified storage location.- Parameters:
storeHandle- the storage location of the Zarr array- Throws:
IOException- throws IOException if the metadata cannot be readZarrException- throws ZarrException if the Zarr array cannot be opened
-
open
Opens an existing Zarr array at a specified storage location using a Path.- Parameters:
path- the storage location of the Zarr array- Throws:
IOException- if the metadata cannot be readZarrException- if the Zarr array cannot be opened
-
open
Opens an existing Zarr array at a specified storage location using a String path.- Parameters:
path- the storage location of the Zarr array- Throws:
IOException- if the metadata cannot be readZarrException- if the Zarr array cannot be opened
-
create
public static Array create(Path path, ArrayMetadata arrayMetadata) throws IOException, ZarrException Creates a new Zarr array with the provided metadata at a specified storage location. This method will raise an exception if a Zarr array already exists at the specified storage location.- Parameters:
path- the storage location of the Zarr arrayarrayMetadata- the metadata of the Zarr array- Throws:
IOException- if the metadata cannot be serializedZarrException- if the Zarr array cannot be created
-
create
public static Array create(String path, ArrayMetadata arrayMetadata) throws IOException, ZarrException Creates a new Zarr array with the provided metadata at a specified storage location. This method will raise an exception if a Zarr array already exists at the specified storage location.- Parameters:
path- the storage location of the Zarr arrayarrayMetadata- the metadata of the Zarr array- Throws:
IOException- if the metadata cannot be serializedZarrException- if the Zarr array cannot be created
-
create
public static Array create(StoreHandle storeHandle, ArrayMetadata arrayMetadata) throws IOException, ZarrException Creates a new Zarr array with the provided metadata at a specified storage location. This method will raise an exception if a Zarr array already exists at the specified storage location.- Parameters:
storeHandle- the storage location of the Zarr arrayarrayMetadata- the metadata of the Zarr array- Throws:
IOException- if the metadata cannot be serializedZarrException- if the Zarr array cannot be created
-
create
public static Array create(StoreHandle storeHandle, ArrayMetadata arrayMetadata, boolean existsOk) throws IOException, ZarrException Creates a new Zarr array with the provided metadata at a specified storage location. If `existsOk` is false, this method will raise an exception if a Zarr array already exists at the specified storage location.- Parameters:
storeHandle- the storage location of the Zarr arrayarrayMetadata- the metadata of the Zarr arrayexistsOk- if true, no exception is raised if the Zarr array already exists- Throws:
IOException- throws IOException if the metadata cannot be serializedZarrException- throws ZarrException if the Zarr array cannot be created
-
create
public static Array create(StoreHandle storeHandle, Function<ArrayMetadataBuilder, ArrayMetadataBuilder> arrayMetadataBuilderMapper, boolean existsOk) throws IOException, ZarrExceptionCreates a new Zarr array at a specified storage location. This method provides a callback that gets an ArrayMetadataBuilder and needs to return such an ArrayMetadataBuilder. The callback can be used to construct the metadata of the Zarr array. If `existsOk` is false, this method will raise an exception if a Zarr array already exists at the specified storage location.- Parameters:
storeHandle- the storage location of the Zarr arrayarrayMetadataBuilderMapper- a callback that is used to construct the metadata of the Zarr arrayexistsOk- if true, no exception is raised if the Zarr array already exists- Throws:
IOException- if the metadata cannot be serializedZarrException- if the Zarr array cannot be created
-
create
public static Array create(Path path, Function<ArrayMetadataBuilder, ArrayMetadataBuilder> arrayMetadataBuilderMapper, boolean existsOk) throws IOException, ZarrException- Throws:
IOExceptionZarrException
-
create
public static Array create(String path, Function<ArrayMetadataBuilder, ArrayMetadataBuilder> arrayMetadataBuilderMapper, boolean existsOk) throws IOException, ZarrException- Throws:
IOExceptionZarrException
-
metadataBuilder
-
metadataBuilder
-
resize
Sets a new shape for the Zarr array. It only changes the metadata, no array data is modified or deleted. This method returns a new instance of the Zarr array class and the old instance becomes invalid.- Parameters:
newShape- the new shape of the Zarr array- Throws:
ZarrException- if the new metadata is invalidIOException- throws IOException if the new metadata cannot be serialized
-
setAttributes
Sets the attributes of the Zarr array. It overwrites and removes any existing attributes. This method returns a new instance of the Zarr array class and the old instance becomes invalid.- Parameters:
newAttributes- the new attributes of the Zarr array- Throws:
ZarrException- throws ZarrException if the new metadata is invalidIOException- throws IOException if the new metadata cannot be serialized
-
updateAttributes
public Array updateAttributes(Function<Map<String, Object>, throws ZarrException, IOExceptionMap<String, Object>> attributeMapper) Updates the attributes of the Zarr array. It provides a callback that gets the current attributes as input and needs to return the new set of attributes. The attributes in the callback may be mutated. This method overwrites and removes any existing attributes. This method returns a new instance of the Zarr array class and the old instance becomes invalid.- Parameters:
attributeMapper- the callback that is used to construct the new attributes- Throws:
ZarrException- throws ZarrException if the new metadata is invalidIOException- throws IOException if the new metadata cannot be serialized
-
toString
-