Package ucar.ma2
Class Index2D
- java.lang.Object
-
- ucar.ma2.Index
-
- ucar.ma2.Index2D
-
-
Constructor Summary
Constructors Constructor Description Index2D(int[] shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
int
currentElement()
Get the current element's index into the 1D backing array.int[]
getCurrentCounter()
Get the current counter.int
incr()
Increment the current element by 1.protected void
precalc()
subclass specialization/optimization calculationsIndex
set(int[] index)
Set the current element's index.Index
set(int v0, int v1)
set current element at dimension 0,1 to v0,v1Index
set0(int v)
set current element at dimension 0 to vIndex
set1(int v)
set current element at dimension 1 to vvoid
setDim(int dim, int value)
set current element at dimension dim to vString
toString()
-
-
-
Method Detail
-
precalc
protected void precalc()
Description copied from class:Index
subclass specialization/optimization calculations
-
getCurrentCounter
public int[] getCurrentCounter()
Description copied from class:Index
Get the current counter.- Overrides:
getCurrentCounter
in classIndex
- Returns:
- copy of the current counter.
-
currentElement
public int currentElement()
Description copied from class:Index
Get the current element's index into the 1D backing array. VLEN stops processing.- Overrides:
currentElement
in classIndex
- Returns:
- the current element's index into the 1D backing array.
-
incr
public int incr()
Description copied from class:Index
Increment the current element by 1. Used by IndexIterator. General rank, with subclass specialization. Vlen skipped.
-
setDim
public void setDim(int dim, int value)
Description copied from class:Index
set current element at dimension dim to v
-
set
public Index set(int[] index)
Description copied from class:Index
Set the current element's index. General-rank case.
-
set0
public Index set0(int v)
Description copied from class:Index
set current element at dimension 0 to v
-
set1
public Index set1(int v)
Description copied from class:Index
set current element at dimension 1 to v
-
set
public Index set(int v0, int v1)
Description copied from class:Index
set current element at dimension 0,1 to v0,v1
-
-