Class MultiDimensionalArray<T>

    • Constructor Detail

      • MultiDimensionalArray

        public MultiDimensionalArray​(int... sizes)
        Creates an instance with the specified size along each dimension.
        Parameters:
        sizes - the sizes of the dimensions
      • MultiDimensionalArray

        public MultiDimensionalArray​(MultiDimensionalCollection<T> that)
        A copy constructor that constructs a shallow copy of the given collection of instances. That is, although the created array structure is independent of the input argument, the stored items are referencing the same collection of instances.
        Parameters:
        that - the collection to copy
    • Method Detail

      • set

        public T set​(T value,
                     int... indices)
        Description copied from interface: MultiDimensionalCollection
        Replaces the element at the specified position in this list with the specified element.
        Specified by:
        set in interface MultiDimensionalCollection<T>
        Parameters:
        value - element to be stored at the specified position
        indices - the indices of the element to replace
      • get

        public T get​(int... indices)
        Description copied from interface: MultiDimensionalCollection
        Returns the element at the specified position in this collection.
        Specified by:
        get in interface MultiDimensionalCollection<T>
        Parameters:
        indices - the indices of the element to return
        Returns:
        the element at the specified position in the list
      • size

        public int size​(int i)
        Description copied from interface: MultiDimensionalCollection
        Returns the size of the collection along the given dimension.
        Specified by:
        size in interface MultiDimensionalCollection<T>
        Parameters:
        i - the index of the dimension for which to determine the size
        Returns:
        the size of the collection along the given dimension