Package uk.ac.rdg.resc.edal.util
Interface Array<E>
-
- Type Parameters:
E
- the type of the values within the array
- All Superinterfaces:
Iterable<E>
- All Known Implementing Classes:
AbstractImmutableArray
,Array1D
,Array2D
,Array4D
,ImmutableArray1D
,LegendDataGenerator.XYNan
,SingleValueImmutableArray1D
,ValuesArray1D
,ValuesArray2D
,ValuesArray4D
public interface Array<E> extends Iterable<E>
An multidimensional array of values- Author:
- Jon Blower, Guy Griffiths
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
equals(Object obj)
E
get(int... coords)
Gets a value from the arrayint
getNDim()
Gets the number of dimensions of the array.int[]
getShape()
Gets the shape of the array, i.e.int
hashCode()
Iterator<E>
iterator()
Returns an iterator over all the values in the array.void
set(E value, int... coords)
Sets a value in the array (optional operation)long
size()
Gets the number of values in the array.-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getNDim
int getNDim()
Gets the number of dimensions of the array. Equal to getShape().length.
-
getShape
int[] getShape()
Gets the shape of the array, i.e. the number of points in each direction.
-
iterator
Iterator<E> iterator()
Returns an iterator over all the values in the array. The convention is that the last dimension (represented by the last entry in getShape()) varies fastest.
-
get
E get(int... coords)
Gets a value from the array
-
set
void set(E value, int... coords)
Sets a value in the array (optional operation)- Throws:
ArrayIndexOutOfBoundsException
- if any of the co-ordinates are beyond the bounds of thisArray
-
size
long size()
Gets the number of values in the array.
-
-