org.eclipse.january.dataset

## Interface ILazyDataset

- All Superinterfaces:
    IMetadataProvider, INameable, Serializable
  All Known Subinterfaces:
    CompoundDataset, Dataset, DateDataset, IDataset, IDynamicDataset, ILazyWriteableDataset
  All Known Implementing Classes:
    AbstractCompoundDataset, AbstractDataset, AggregateDataset, BooleanDataset, BooleanDatasetBase, ByteDataset, ComplexDoubleDataset, ComplexFloatDataset, CompoundByteDataset, CompoundDoubleDataset, CompoundFloatDataset, CompoundIntegerDataset, CompoundLongDataset, CompoundShortDataset, DateDatasetImpl, DoubleDataset, FloatDataset, IntegerDataset, LazyDataset, LazyDatasetBase, LazyDynamicDataset, LazyWriteableDataset, LongDataset, ObjectDataset, ObjectDatasetBase, RGBDataset, ShortDataset, StringDataset, StringDatasetBase

      public interface ILazyDataset
      extends Serializable, IMetadataProvider, INameable

  This interface defines the lazy parts of a dataset. A dataset is a N-dimensional array of items where N can be zero to represent a zero-rank or single-valued dataset. A zero-rank dataset has an empty array for shape. An item comprises a number of elements.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMetadata(MetadataType metadata)` Add metadata to the dataset
    `void` | `clearMetadata(Class<? extends MetadataType> clazz)` Remove metadata of given class
    `ILazyDataset` | `clone()` Clone dataset
    `Class<?>` | `getElementClass()`
    `int` | `getElementsPerItem()`
    `ILazyDataset` | `getErrors()` Get the errors, if any.
    `int` | `getRank()` The rank (or number of dimensions/indices) of the dataset can be zero for a zero-rank (single-valued) dataset
    `int[]` | `getShape()` The shape (or array of lengths for each dimension) of the dataset can be empty for zero-rank datasets
    `int` | `getSize()` The size of the dataset is the number of items in the array
    `IDataset` | `getSlice(IMonitor monitor, int[] start, int[] stop, int[] step)` Get a slice of the dataset.
    `IDataset` | `getSlice(IMonitor monitor, Slice... slice)` Get a slice of the dataset.
    `IDataset` | `getSlice(IMonitor monitor, SliceND slice)` Get a slice of the dataset.
    `IDataset` | `getSlice(int[] start, int[] stop, int[] step)` Get a slice of the dataset.
    `IDataset` | `getSlice(Slice... slice)` Get a slice of the dataset.
    `IDataset` | `getSlice(SliceND slice)` Get a slice of the dataset.
    `ILazyDataset` | `getSliceView(int[] start, int[] stop, int[] step)` Get a slice of the dataset.
    `ILazyDataset` | `getSliceView(Slice... slice)` Get a slice of the dataset.
    `ILazyDataset` | `getSliceView(SliceND slice)` Get a slice of the dataset.
    `ILazyDataset` | `getTransposedView(int... axes)` Permute copy of dataset's axes so that given order is old order:
    `boolean` | `hasErrors()` If error information is set, returns true.
    `void` | `setErrors(Serializable errors)` Set the errors.
    `void` | `setMetadata(MetadataType metadata)` Set metadata on the dataset
    `void` | `setShape(int... shape)` Set a compatible shape for dataset.
    `ILazyDataset` | `squeezeEnds()` Remove dimensions of 1 from ends of shape of the dataset

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

      `getFirstMetadata, getMetadata, getMetadata`

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

      `getName, setName`

- - ### Method Detail

    - #### getElementClass

          Class<?> getElementClass()

      Returns:
        Boxed class of element

    - #### getElementsPerItem

          int getElementsPerItem()

      Returns:
        Number of elements per item

    - #### getSize

          int getSize()

      The size of the dataset is the number of items in the array
      Returns:
        number of data items

    - #### getShape

          int[] getShape()

      The shape (or array of lengths for each dimension) of the dataset can be empty for zero-rank datasets
      Returns:
        Copy of shape of dataset

    - #### setShape

          void setShape(int... shape)

      Set a compatible shape for dataset. A shape is compatible if it has the capacity to contain the same number of items
      Parameters:
        `shape` -

    - #### getRank

          int getRank()

      The rank (or number of dimensions/indices) of the dataset can be zero for a zero-rank (single-valued) dataset
      Returns:
        rank

    - #### squeezeEnds

          ILazyDataset squeezeEnds()

      Remove dimensions of 1 from ends of shape of the dataset

    - #### getSlice

          IDataset getSlice(int[] start,
                          int[] stop,
                          int[] step)
                            throws DatasetException

      Get a slice of the dataset. The returned dataset is a copied selection of items
      Parameters:
        `start` - specifies the starting indexes (can be null for origin)
        `stop` - specifies the stopping indexes (can be null for end)
        `step` - specifies the steps in the slice (can be null for unit steps)
      Returns:
        The dataset of the sliced data
      Throws:
        `DatasetException`

    - #### getSlice

          IDataset getSlice(IMonitor monitor,
                          int[] start,
                          int[] stop,
                          int[] step)
                            throws DatasetException

      Get a slice of the dataset. The returned dataset is a copied selection of items
      Parameters:
        `monitor` -
        `start` - specifies the starting indexes (can be null for origin)
        `stop` - specifies the stopping indexes (can be null for end)
        `step` - specifies the steps in the slice (can be null for unit steps)
      Returns:
        The dataset of the sliced data
      Throws:
        `DatasetException`

    - #### getSlice

          IDataset getSlice(Slice... slice)
                            throws DatasetException

      Get a slice of the dataset. The returned dataset is a copied selection of items
      Parameters:
        `slice` - an array of slice objects (the array can be null or contain nulls)
      Returns:
        The dataset of the sliced data
      Throws:
        `DatasetException`

    - #### getSlice

          IDataset getSlice(IMonitor monitor,
                          Slice... slice)
                            throws DatasetException

      Get a slice of the dataset. The returned dataset is a copied selection of items
      Parameters:
        `monitor` -
        `slice` - an array of slice objects (the array can be null or contain nulls)
      Returns:
        The dataset of the sliced data
      Throws:
        `DatasetException`

    - #### getSlice

          IDataset getSlice(SliceND slice)
                            throws DatasetException

      Get a slice of the dataset. The returned dataset is a copied selection of items
      Parameters:
        `slice` - an n-D slice
      Returns:
        The dataset of the sliced data
      Throws:
        `DatasetException`

    - #### getSlice

          IDataset getSlice(IMonitor monitor,
                          SliceND slice)
                            throws DatasetException

      Get a slice of the dataset. The returned dataset is a copied selection of items
      Parameters:
        `monitor` -
        `slice` - an n-D slice
      Returns:
        The dataset of the sliced data
      Throws:
        `DatasetException`

    - #### getSliceView

          ILazyDataset getSliceView(int[] start,
                                  int[] stop,
                                  int[] step)

      Get a slice of the dataset. The returned lazy dataset is a view on a selection of items
      Parameters:
        `start` - specifies the starting indexes (can be null for origin)
        `stop` - specifies the stopping indexes (can be null for end)
        `step` - specifies the steps in the slice (can be null for unit steps)
      Returns:
        The sliced view of a lazy dataset

    - #### getSliceView

          ILazyDataset getSliceView(Slice... slice)

      Get a slice of the dataset. The returned lazy dataset is a view on a selection of items
      Parameters:
        `slice` - an array of slice objects (the array can be null or contain nulls)
      Returns:
        The sliced view of a lazy dataset

    - #### getSliceView

          ILazyDataset getSliceView(SliceND slice)

      Get a slice of the dataset. The returned lazy dataset is a view on a selection of items
      Parameters:
        `slice` - an n-D slice
      Returns:
        The sliced view of a lazy dataset

    - #### getTransposedView

          ILazyDataset getTransposedView(int... axes)

      Permute copy of dataset's axes so that given order is old order:

          axisPerm = (p(0), p(1),...) => newdata(n(0), n(1),...) = olddata(o(0), o(1), ...)
            such that n(i) = o(p(i)) for all i

      I.e. for a 3D dataset (1,0,2) implies the new dataset has its 1st dimension running along the old dataset's 2nd dimension and the new 2nd is the old 1st. The 3rd dimension is left unchanged.
      Parameters:
        `axes` - if zero length then axes order reversed
      Returns:
        remapped view of data

    - #### addMetadata

          void addMetadata(MetadataType metadata)

      Add metadata to the dataset
      Parameters:
        `metadata` -

    - #### setMetadata

          void setMetadata(MetadataType metadata)

      Set metadata on the dataset
      Parameters:
        `metadata` - (null is ignored so use clear(null) instead)

    - #### clearMetadata

          void clearMetadata(Class<? extends MetadataType> clazz)

      Remove metadata of given class
      Parameters:
        `clazz` - if null remove everything

    - #### clone

          ILazyDataset clone()

      Clone dataset
      Returns:
        a (shallow) copy of dataset

    - #### setErrors

          void setErrors(Serializable errors)

      Set the errors. It may be a single double, a double array or a whole dataset that can broadcast to the dataset
      Parameters:
        `errors` - - may be null to remove the error set
      Throws:
        `RuntimeException` - if the rank or shape are incorrect
      Since:
        2.0

    - #### getErrors

          ILazyDataset getErrors()

      Get the errors, if any. These will be in a shape that can broadcast to the dataset
      Since:
        2.0

    - #### hasErrors

          boolean hasErrors()

      If error information is set, returns true. Faster to call than getError() which constructs a new dataset.
      Returns:
        true if there is error data.

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