Package uk.ac.rdg.resc.edal.util
Class AbstractImmutableArray<T>
- java.lang.Object
-
- uk.ac.rdg.resc.edal.util.AbstractImmutableArray<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]shape
-
Constructor Summary
Constructors Constructor Description AbstractImmutableArray(int... shape)Instantiate a newAbstractImmutableArray
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetNDim()Gets the number of dimensions of the array.int[]getShape()Gets the shape of the array, i.e.Iterator<T>iterator()Returns an iterator over all the values in the array.voidset(T value, int... coords)Sets a value in the array (optional operation)longsize()Gets the number of values in the array.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
AbstractImmutableArray
public AbstractImmutableArray(int... shape)
Instantiate a newAbstractImmutableArray- Parameters:
shape- The shape of theArray. The final dimension varies fastest. In GIS applications, the standard order for co-ordinates is T, Z, Y, X
-
-
Method Detail
-
getNDim
public int getNDim()
Description copied from interface:ArrayGets the number of dimensions of the array. Equal to getShape().length.
-
getShape
public int[] getShape()
Description copied from interface:ArrayGets the shape of the array, i.e. the number of points in each direction.
-
iterator
public Iterator<T> iterator()
Description copied from interface:ArrayReturns 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.
-
set
public void set(T value, int... coords)
Description copied from interface:ArraySets a value in the array (optional operation)
-
-