org.eclipse.january.dataset

## Class LazyDynamicDataset

- java.lang.Object
- - org.eclipse.january.dataset.LazyDatasetBase
  - - org.eclipse.january.dataset.LazyDataset
    - - org.eclipse.january.dataset.LazyDynamicDataset

- All Implemented Interfaces:
    Serializable, Cloneable, IDynamicDataset, IDynamicShape, ILazyDataset, IMetadataProvider, INameable
  Direct Known Subclasses:
    LazyWriteableDataset

      public class LazyDynamicDataset
      extends LazyDataset
      implements IDynamicDataset

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected IDatasetChangeChecker` | `checker`
    `protected int[]` | `chunks`
    `protected DataListenerDelegate` | `eventDelegate`
    `protected int[]` | `maxShape`

    - ### Fields inherited from class org.eclipse.january.dataset.LazyDataset

      `begSlice, delSlice, isize, loader, map, oMetadata, oShape, padding, size, sShape`

    - ### Fields inherited from class org.eclipse.january.dataset.LazyDatasetBase

      `metadata, name, shape`

    - ### Fields inherited from interface org.eclipse.january.dataset.IDynamicDataset

      `UNLIMITED`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `LazyDynamicDataset(ILazyLoader loader, String name, int elements, Class<? extends Dataset> clazz, int[] shape, int[] maxShape)` Create a dynamic lazy dataset
    `` | `LazyDynamicDataset(ILazyLoader loader, String name, int elements, Class<? extends Dataset> clazz, int[] shape, int[] maxShape, int[] chunks)` Create a dynamic lazy dataset
    `protected` | `LazyDynamicDataset(LazyDynamicDataset other)`
    `` | `LazyDynamicDataset(String name, int elements, Class<? extends Dataset> clazz, int[] shape, int[] maxShape, ILazyLoader loader)` Deprecated. Use `LazyDynamicDataset(ILazyLoader, String, int, Class, int[], int[])`
    `` | `LazyDynamicDataset(String name, int dtype, int elements, int[] shape, int[] maxShape, ILazyLoader loader)` Deprecated. Use `LazyDynamicDataset(ILazyLoader, String, int, Class, int[], int[])`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDataListener(IDataListener l)` Add a listener which will be fired when aspects of the data change for instance shape or content.
    `protected void` | `checkSliceND(SliceND slice)` Check if slice is compatible with dataset's shape
    `LazyDynamicDataset` | `clone()` Clone dataset
    `protected SliceND` | `createSlice(int[] nstart, int[] nstop, int[] nstep)`
    `boolean` | `equals(Object obj)`
    `void` | `fireDataListeners()` Alert any registered listeners
    `int[]` | `getChunking()` Get chunking
    `ILazyDataset` | `getDataset()`
    `int[]` | `getMaxShape()`
    `int` | `hashCode()`
    `boolean` | `refreshShape()` Force the shape to be re-read from file, if possible
    `void` | `removeDataListener(IDataListener l)` Remove a listener which will be fired when aspects of the data change for instance shape or content.
    `boolean` | `resize(int... newShape)` Change shape
    `void` | `setChunking(int... chunks)` Set chunking
    `void` | `setMaxShape(int... maxShape)` Set maximum shape
    `void` | `startUpdateChecker(int milliseconds, IDatasetChangeChecker checker)` Starts a periodic checker to see if dataset has changed in some manner.

    - ### Methods inherited from class org.eclipse.january.dataset.LazyDataset

      `calcTrueSlice, createLazyDataset, getDType, getElementClass, getElementsPerItem, getInterface, getMaxSliceLength, getSize, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceView, getSliceView, getSliceView, getTransposedView, internalGetSlice, internalGetSliceView, setInterface, setShape, squeezeEnds, toString`

    - ### Methods inherited from class org.eclipse.january.dataset.LazyDatasetBase

      `addMetadata, checkPermutatedAxes, clearMetadata, copyMetadata, copyMetadata, createFromSerializable, dirtyMetadata, findMetadataTypeSubInterfaces, getErrorMetadata, getErrors, getFirstMetadata, getMetadata, getMetadata, getMetadataMap, getName, getRank, getShape, hasErrors, reshapeMetadata, restoreMetadata, setDirty, setErrors, setMetadata, setName, sliceMetadata, transposeMetadata`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.january.dataset.ILazyDataset

      `addMetadata, clearMetadata, getElementClass, getElementsPerItem, getErrors, getRank, getShape, getSize, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceView, getSliceView, getSliceView, getTransposedView, hasErrors, setErrors, setMetadata, setShape, squeezeEnds`

    - ### Methods inherited from interface org.eclipse.january.dataset.IMetadataProvider

      `getFirstMetadata, getMetadata, getMetadata`

    - ### Methods inherited from interface org.eclipse.january.INameable

      `getName, setName`

- - ### Field Detail

    - #### maxShape

          protected int[] maxShape

    - #### chunks

          protected int[] chunks

    - #### eventDelegate

          protected transient DataListenerDelegate eventDelegate

    - #### checker

          protected IDatasetChangeChecker checker

  - ### Constructor Detail

    - #### LazyDynamicDataset

          @Deprecated
          public LazyDynamicDataset(String name,
                                                int dtype,
                                                int elements,
                                                int[] shape,
                                                int[] maxShape,
                                                ILazyLoader loader)

      Deprecated. Use `LazyDynamicDataset(ILazyLoader, String, int, Class, int[], int[])`
      Create a dynamic lazy dataset
      Parameters:
        `name` - of dataset
        `dtype` - dataset type
        `elements` - item size
        `shape` - dataset shape
        `maxShape` - maximum shape
        `loader` - lazy loader

    - #### LazyDynamicDataset

          @Deprecated
          public LazyDynamicDataset(String name,
                                                int elements,
                                                Class<? extends Dataset> clazz,
                                                int[] shape,
                                                int[] maxShape,
                                                ILazyLoader loader)

      Deprecated. Use `LazyDynamicDataset(ILazyLoader, String, int, Class, int[], int[])`
      Create a dynamic lazy dataset
      Parameters:
        `name` - of dataset
        `elements` - item size
        `clazz` - dataset sub-interface
        `shape` - dataset shape
        `maxShape` - maximum shape
        `loader` - lazy loader
      Since:
        2.3

    - #### LazyDynamicDataset

          public LazyDynamicDataset(ILazyLoader loader,
                                    String name,
                                    int elements,
                                    Class<? extends Dataset> clazz,
                                    int[] shape,
                                    int[] maxShape)

      Create a dynamic lazy dataset
      Parameters:
        `loader` - lazy loader
        `name` - of dataset
        `elements` - item size
        `clazz` - dataset sub-interface
        `shape` - dataset shape
        `maxShape` - maximum shape
      Since:
        2.3

    - #### LazyDynamicDataset

          public LazyDynamicDataset(ILazyLoader loader,
                                    String name,
                                    int elements,
                                    Class<? extends Dataset> clazz,
                                    int[] shape,
                                    int[] maxShape,
                                    int[] chunks)

      Create a dynamic lazy dataset
      Parameters:
        `loader` - lazy loader
        `name` - of dataset
        `elements` - item size
        `clazz` - dataset sub-interface
        `shape` - dataset shape
        `maxShape` - maximum shape
        `chunks` - chunk shape
      Since:
        2.3

    - #### LazyDynamicDataset

          protected LazyDynamicDataset(LazyDynamicDataset other)

      Parameters:
        `other` - dataset to clone
      Since:
        2.2

  - ### Method Detail

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `LazyDataset`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `LazyDataset`

    - #### getDataset

          public ILazyDataset getDataset()

      Specified by:
        `getDataset` in interface `IDynamicShape`
      Returns:
        dataset associated with shape

    - #### addDataListener

          public void addDataListener(IDataListener l)

      Description copied from interface: `IDynamicShape`
      Add a listener which will be fired when aspects of the data change for instance shape or content.
      Specified by:
        `addDataListener` in interface `IDynamicShape`
      Parameters:
        `l` - listener

    - #### removeDataListener

          public void removeDataListener(IDataListener l)

      Description copied from interface: `IDynamicShape`
      Remove a listener which will be fired when aspects of the data change for instance shape or content.
      Specified by:
        `removeDataListener` in interface `IDynamicShape`
      Parameters:
        `l` - listener

    - #### fireDataListeners

          public void fireDataListeners()

      Description copied from interface: `IDynamicShape`
      Alert any registered listeners
      Specified by:
        `fireDataListeners` in interface `IDynamicShape`

    - #### refreshShape

          public boolean refreshShape()

      Description copied from interface: `IDynamicShape`
      Force the shape to be re-read from file, if possible
      Specified by:
        `refreshShape` in interface `IDynamicShape`
      Returns:
        true if shape has changed

    - #### resize

          public boolean resize(int... newShape)

      Description copied from interface: `IDynamicShape`
      Change shape
      Specified by:
        `resize` in interface `IDynamicShape`
      Parameters:
        `newShape` - new shape
      Returns:
        true if shape has changed

    - #### getMaxShape

          public int[] getMaxShape()

      Specified by:
        `getMaxShape` in interface `IDynamicShape`
      Returns:
        maximum shape (can be null)

    - #### setMaxShape

          public void setMaxShape(int... maxShape)

      Description copied from interface: `IDynamicShape`
      Set maximum shape
      Specified by:
        `setMaxShape` in interface `IDynamicShape`
      Parameters:
        `maxShape` - maximum shape

    - #### getChunking

          public int[] getChunking()

      Description copied from interface: `IDynamicDataset`
      Get chunking
      Specified by:
        `getChunking` in interface `IDynamicDataset`
      Returns:
        chunks (can be null)

    - #### setChunking

          public void setChunking(int... chunks)

      Description copied from interface: `IDynamicDataset`
      Set chunking
      Specified by:
        `setChunking` in interface `IDynamicDataset`
      Parameters:
        `chunks` - chunk shape

    - #### checkSliceND

          protected void checkSliceND(SliceND slice)

      Description copied from class: `LazyDatasetBase`
      Check if slice is compatible with dataset's shape
      Overrides:
        `checkSliceND` in class `LazyDatasetBase`
      Parameters:
        `slice` - to check

    - #### createSlice

          protected SliceND createSlice(int[] nstart,
                                        int[] nstop,
                                        int[] nstep)

      Overrides:
        `createSlice` in class `LazyDataset`

    - #### clone

          public LazyDynamicDataset clone()

      Description copied from interface: `ILazyDataset`
      Clone dataset
      Specified by:
        `clone` in interface `ILazyDataset`
      Overrides:
        `clone` in class `LazyDataset`
      Returns:
        a (shallow) copy of dataset

    - #### startUpdateChecker

          public void startUpdateChecker(int milliseconds,
                                         IDatasetChangeChecker checker)

      Description copied from interface: `IDynamicShape`
      Starts a periodic checker to see if dataset has changed in some manner. If any potential changes are detected after the period has finished then registered listeners are alerted. A period of 0 or less will stop any existing checker.
      Specified by:
        `startUpdateChecker` in interface `IDynamicShape`
      Parameters:
        `milliseconds` - period between checks in milliseconds
        `checker` - can be null for default implementation of alerting listeners unconditionally

Copyright © 2014–2022 Eclipse Foundation. All rights reserved.