Interface MultiArray<T>

  • Type Parameters:
    T - generics for primitive array (ie. double[], float[], int[] ...)

    public interface MultiArray<T>
    Interface for multi-dimensional arrays of any type. The representation of multi-dimensional array is in fact one-dimensional array, because of 2 reasons: - we always want to support only rectangle arrays (not arbitrary row length) - it corresponds to C++ implementation, where 1D array is used as well (to support static multi-dimensional arrays)
    Author:
    Ilia Yastrebov, CERN, Joel Lauener, CERN, rstein
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object get​(int index)
      Returns the element at a given indices.
      java.lang.Object get​(int[] indices)
      Returns the element at given indices.
      boolean getBoolean​(int[] indices)
      Returns the element at given indices.
      byte getByte​(int[] indices)
      Returns the element at given indices.
      int[] getDimensions()
      Returns the dimensions of the array.
      double getDouble​(int[] indices)
      Returns the element at given indices.
      T getElements()
      Returns the array of all elements of multi-dimensional array.
      int getElementsCount()
      Returns the number of elements in the multi-dimensional array.
      float getFloat​(int[] indices)
      Returns the element at given indices.
      int getIndex​(int[] indices)
      Returns the element at given indices.
      int getInt​(int[] indices)
      Returns the element at given indices.
      long getLong​(int[] indices)
      Returns the element at given indices.
      short getShort​(int[] indices)
      Returns the element at given indices.
      java.lang.String getString​(int[] indices)
      Returns the element at given indices.
    • Method Detail

      • get

        java.lang.Object get​(int index)
        Returns the element at a given indices.
        Parameters:
        index - the indices
        Returns:
        the element
      • get

        java.lang.Object get​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the element
      • getBoolean

        boolean getBoolean​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the primitive element
      • getByte

        byte getByte​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the primitive element
      • getDimensions

        int[] getDimensions()
        Returns the dimensions of the array.
        Returns:
        the dimensions
      • getDouble

        double getDouble​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the primitive element
      • getElements

        T getElements()
        Returns the array of all elements of multi-dimensional array.
        Returns:
        the array of all elements
      • getElementsCount

        int getElementsCount()
        Returns the number of elements in the multi-dimensional array.
        Returns:
        the number of elements
      • getFloat

        float getFloat​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the primitive element
      • getIndex

        int getIndex​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        index for the one-dimensional array
      • getInt

        int getInt​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the primitive element
      • getLong

        long getLong​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the primitive element
      • getShort

        short getShort​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the primitive element
      • getString

        java.lang.String getString​(int[] indices)
        Returns the element at given indices.
        Parameters:
        indices - position of the element in the multi-dimensional array
        Returns:
        the element