org.eclipse.january.dataset

## Interface IDataset

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

      public interface IDataset
      extends ILazyDataset

  This interface defines the implementation-independent and generic parts of a dataset.

  The position array used in the getters

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IDataset` | `clone()` Clone dataset, making new copy of data
    `boolean` | `getBoolean(int... pos)`
    `byte` | `getByte(int... pos)`
    `double` | `getDouble(int... pos)`
    `double` | `getError(int... pos)` Get the error for a given position.
    `double[]` | `getErrorArray(int... pos)` Get the error values for a single point in the dataset
    `IDataset` | `getErrors()` Get the errors, if any.
    `float` | `getFloat(int... pos)`
    `int` | `getInt(int... pos)`
    `int` | `getItemBytes()`
    `long` | `getLong(int... pos)`
    `IMetadata` | `getMetadata()` Deprecated. Use `getFirstMetadata(IMetadata.class)` instead
    `Object` | `getObject(int... pos)`
    `short` | `getShort(int... pos)`
    `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.
    `IDataset` | `getSliceView(int[] start, int[] stop, int[] step)` Get a slice of the dataset.
    `IDataset` | `getSliceView(Slice... slice)` Get a slice of the dataset.
    `IDataset` | `getSliceView(SliceND slice)` Get a slice of the dataset.
    `String` | `getString(int... pos)`
    `IDataset` | `getTransposedView(int... axes)` Permute copy of dataset's axes so that given order is old order:
    `Number` | `max(boolean... ignoreInvalids)`
    `int[]` | `maxPos(boolean... ignoreInvalids)`
    `Object` | `mean(boolean... ignoreInvalids)`
    `Number` | `min(boolean... ignoreInvalids)`
    `int[]` | `minPos(boolean... ignoreInvalids)`
    `void` | `resize(int... newShape)` Change shape and size of dataset in-place
    `void` | `set(Object obj, int... pos)` Set the value given by object at given position
    `void` | `setStringFormat(Format format)` Set string output format
    `IDataset` | `squeeze()` Remove dimensions of 1 in shape of the dataset
    `IDataset` | `squeeze(boolean onlyFromEnds)` Remove dimensions of 1 in shape of the dataset from ends only if true
    `IDataset` | `squeezeEnds()` Remove dimensions of 1 from ends of shape of the dataset

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

      `addMetadata, clearMetadata, getElementClass, getElementsPerItem, getRank, getShape, getSize, getSlice, getSlice, getSlice, hasErrors, setErrors, setMetadata, setShape`

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

      `getFirstMetadata, getMetadata`

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

      `getName, setName`

- - ### Method Detail

    - #### setStringFormat

          void setStringFormat(Format format)

      Set string output format
      Parameters:
        `format` -

    - #### getItemBytes

          int getItemBytes()

      Returns:
        Size of an item in dataset in bytes

    - #### getObject

          Object getObject(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as an object

    - #### getString

          String getString(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as a string

    - #### getDouble

          double getDouble(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as a double

    - #### getLong

          long getLong(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as a long

    - #### getFloat

          float getFloat(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as a float

    - #### getInt

          int getInt(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as an int

    - #### getShort

          short getShort(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as a short

    - #### getByte

          byte getByte(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as a byte

    - #### getBoolean

          boolean getBoolean(int... pos)

      Parameters:
        `pos` -
      Returns:
        Item in given position as a boolean

    - #### set

          void set(Object obj,
                 int... pos)

      Set the value given by object at given position
      Parameters:
        `obj` -
        `pos` -

    - #### resize

          void resize(int... newShape)

      Change shape and size of dataset in-place
      Parameters:
        `newShape` -

    - #### squeezeEnds

          IDataset squeezeEnds()

      Description copied from interface: `ILazyDataset`
      Remove dimensions of 1 from ends of shape of the dataset
      Specified by:
        `squeezeEnds` in interface `ILazyDataset`

    - #### squeeze

          IDataset squeeze()

      Remove dimensions of 1 in shape of the dataset

    - #### squeeze

          IDataset squeeze(boolean onlyFromEnds)

      Remove dimensions of 1 in shape of the dataset from ends only if true
      Parameters:
        `onlyFromEnds` -

    - #### max

          Number max(boolean... ignoreInvalids)

      Parameters:
        `ignoreInvalids` - - Can be null, empty, or one or more booleans. By default, all booleans are false. If the first boolean is true, will ignore NaNs and ignore infinities. Use the second boolean to ignore infinities separately.
      Returns:
        Maximum value
      Throws:
        `UnsupportedOperationException` - if comparisons are not valid

    - #### mean

          Object mean(boolean... ignoreInvalids)

      Parameters:
        `ignoreInvalids` - - see `max(boolean...)`
      Returns:
        mean of all items in dataset as a double, array of doubles or a complex number

    - #### min

          Number min(boolean... ignoreInvalids)

      Parameters:
        `ignoreInvalids` - - see `max(boolean...)`
      Returns:
        Minimum value
      Throws:
        `UnsupportedOperationException` - if comparisons are not valid

    - #### minPos

          int[] minPos(boolean... ignoreInvalids)

      Parameters:
        `ignoreInvalids` - - see `max(boolean...)`
      Returns:
        Position of minimum value (or first position if there are more than one)
      Since:
        2.0

    - #### maxPos

          int[] maxPos(boolean... ignoreInvalids)

      Parameters:
        `ignoreInvalids` - - see `max(boolean...)`
      Returns:
        Position of maximum value (or first position if there are more than one)
      Since:
        2.0

    - #### clone

          IDataset clone()

      Clone dataset, making new copy of data
      Specified by:
        `clone` in interface `ILazyDataset`
      Returns:
        a (deep) copy of dataset

    - #### getMetadata

          @Deprecated
          IMetadata getMetadata()

      Deprecated. Use `getFirstMetadata(IMetadata.class)` instead
      Specified by:
        `getMetadata` in interface `IMetadataProvider`
      Returns:
        an instance of IMetadata, may be null

    - #### getSlice

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

      Description copied from interface: `ILazyDataset`
      Get a slice of the dataset. The returned dataset is a copied selection of items
      Specified by:
        `getSlice` in interface `ILazyDataset`
      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

    - #### getSlice

          IDataset getSlice(Slice... slice)

      Description copied from interface: `ILazyDataset`
      Get a slice of the dataset. The returned dataset is a copied selection of items
      Specified by:
        `getSlice` in interface `ILazyDataset`
      Parameters:
        `slice` - an array of slice objects (the array can be null or contain nulls)
      Returns:
        The dataset of the sliced data

    - #### getSlice

          IDataset getSlice(SliceND slice)

      Description copied from interface: `ILazyDataset`
      Get a slice of the dataset. The returned dataset is a copied selection of items
      Specified by:
        `getSlice` in interface `ILazyDataset`
      Parameters:
        `slice` - an n-D slice
      Returns:
        The dataset of the sliced data

    - #### getSliceView

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

      Get a slice of the dataset. The returned dataset is a view on a selection of items
      Specified by:
        `getSliceView` in interface `ILazyDataset`
      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 dataset

    - #### getSliceView

          IDataset getSliceView(Slice... slice)

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

    - #### getSliceView

          IDataset getSliceView(SliceND slice)

      Get a slice of the dataset. The returned dataset is a view on a selection of items
      Specified by:
        `getSliceView` in interface `ILazyDataset`
      Parameters:
        `slice` - an nD slice object
      Returns:
        The sliced view of a dataset

    - #### getTransposedView

          IDataset 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.
      Specified by:
        `getTransposedView` in interface `ILazyDataset`
      Parameters:
        `axes` - if zero length then axes order reversed
      Returns:
        remapped view of data

    - #### getErrors

          IDataset getErrors()

      Description copied from interface: `ILazyDataset`
      Get the errors, if any. These will be in a shape that can broadcast to the dataset
      Specified by:
        `getErrors` in interface `ILazyDataset`
      Returns:
        the error dataset, constructing one if necessary
      Since:
        2.0

    - #### getError

          double getError(int... pos)

      Get the error for a given position.
      Parameters:
        `pos` -
      Returns:
        error value (symmetric)

    - #### getErrorArray

          double[] getErrorArray(int... pos)

      Get the error values for a single point in the dataset
      Parameters:
        `pos` - of the point to be referenced
      Returns:
        the values of the error at this point (can be null when no error defined)

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