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 DataListenerDelegate` | `eventDelegate`
    `protected int[]` | `maxShape`

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

      `base, begSlice, delSlice, dtype, isize, loader, map, oMetadata, oShape, postShape, prepShape, size`

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

      `catchExceptions, logger, metadata, name, shape`

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

      `UNLIMITED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LazyDynamicDataset(String name, int dtype, int elements, int[] shape, int[] maxShape, ILazyLoader loader)`

  - ### Method Summary

    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.
    `LazyDynamicDataset` | `clone()` Clone dataset
    `void` | `fireDataListeners()` Alert any registered listeners
    `ILazyDataset` | `getDataset()`
    `int[]` | `getMaxShape()`
    `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` | `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, createSlice, equals, getDType, getElementsPerItem, getMaxSliceLength, getSize, getSlice, getSlice, getSlice, getSlice, getSlice, getSlice, getSliceView, getSliceView, getSliceView, getTransposedView, setShape, squeezeEnds, toString, transformInput`

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

      `addMetadata, checkPermutatedAxes, clearMetadata, copyMetadata, copyMetadata, createFromSerializable, dirtyMetadata, findMetadataTypeSubInterfaces, getElementClass, getErrorMetadata, getErrors, getFirstMetadata, getMetadata, getMetadata, getName, getRank, getShape, hasErrors, hashCode, 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

    - #### eventDelegate

          protected transient DataListenerDelegate eventDelegate

    - #### checker

          protected IDatasetChangeChecker checker

  - ### Constructor Detail

    - #### LazyDynamicDataset

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

  - ### Method Detail

    - #### 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`

    - #### 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`

    - #### 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`
      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

    - #### 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 © 2017. All rights reserved.