ucar.ma2
Class Index5D

java.lang.Object
  extended by ucar.ma2.Index
      extended by ucar.ma2.Index5D
All Implemented Interfaces:
Cloneable

public class Index5D
extends Index

Specialization of Index for rank 5 arrays.

Author:
caron
See Also:
Index

Field Summary
 
Fields inherited from class ucar.ma2.Index
current, offset, rank, scalarIndexImmutable, shape, size, stride
 
Constructor Summary
Index5D(int[] shape)
           
 
Method Summary
 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 calculations
 Index set(int[] index)
          Set the current element's index.
 Index set(int v0, int v1, int v2, int v3, int v4)
          set current element at dimension 0,1,2,3,4 to v0,v1,v2,v3,v4
 Index set0(int v)
          set current element at dimension 0 to v
 Index set1(int v)
          set current element at dimension 1 to v
 Index set2(int v)
          set current element at dimension 2 to v
 Index set3(int v)
          set current element at dimension 3 to v
 Index set4(int v)
          set current element at dimension 4 to v
 void setDim(int dim, int value)
          set current element at dimension dim to v
 String toString()
           
 
Methods inherited from class ucar.ma2.Index
computeSize, factory, getRank, getShape, getShape, getSize, set, set, set, set, set, set, set5, set6, setCurrentCounter, toStringDebug
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Index5D

public Index5D(int[] shape)
Method Detail

precalc

protected void precalc()
Description copied from class: Index
subclass specialization/optimization calculations

Overrides:
precalc in class Index

toString

public String toString()
Overrides:
toString in class Index

getCurrentCounter

public int[] getCurrentCounter()
Description copied from class: Index
Get the current counter.

Overrides:
getCurrentCounter in class Index
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.

Overrides:
currentElement in class Index
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.

Overrides:
incr in class Index
Returns:
currentElement()

setDim

public void setDim(int dim,
                   int value)
Description copied from class: Index
set current element at dimension dim to v

Overrides:
setDim in class Index
Parameters:
dim - set this dimension
value - to this value

set0

public Index set0(int v)
Description copied from class: Index
set current element at dimension 0 to v

Overrides:
set0 in class Index
Parameters:
v - set 0th dimension index to this value
Returns:
this, so you can use A.get(i.set(i))

set1

public Index set1(int v)
Description copied from class: Index
set current element at dimension 1 to v

Overrides:
set1 in class Index
Parameters:
v - set dimension 1 index to this value
Returns:
this, so you can use A.get(i.set(i))

set2

public Index set2(int v)
Description copied from class: Index
set current element at dimension 2 to v

Overrides:
set2 in class Index
Parameters:
v - set dimension 2 index to this value
Returns:
this, so you can use A.get(i.set(i))

set3

public Index set3(int v)
Description copied from class: Index
set current element at dimension 3 to v

Overrides:
set3 in class Index
Parameters:
v - set dimension 3 index to this value
Returns:
this, so you can use A.get(i.set(i))

set4

public Index set4(int v)
Description copied from class: Index
set current element at dimension 4 to v

Overrides:
set4 in class Index
Parameters:
v - set dimension 4 index to this value
Returns:
this, so you can use A.get(i.set(i))

set

public Index set(int[] index)
Description copied from class: Index
Set the current element's index. General-rank case.

Overrides:
set in class Index
Parameters:
index - set current value to these values
Returns:
this, so you can use A.get(i.set(i))

set

public Index set(int v0,
                 int v1,
                 int v2,
                 int v3,
                 int v4)
Description copied from class: Index
set current element at dimension 0,1,2,3,4 to v0,v1,v2,v3,v4

Overrides:
set in class Index
Parameters:
v0 - set dimension 0 index to this value
v1 - set dimension 1 index to this value
v2 - set dimension 2 index to this value
v3 - set dimension 3 index to this value
v4 - set dimension 4 index to this value
Returns:
this, so you can use A.get(i.set(i,j,k,l,m))

clone

public Object clone()
Overrides:
clone in class Index


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.