Package ucar.ma2
Interface IndexIterator
-
- All Known Implementing Classes:
IteratorFast
public interface IndexIterator
Iteration through each element of an Array in "canonical order". The user obtains this by calling getIndexIterator() on an Array. Canonical order for A[i][j][k] has k varying fastest, then j, then i.
Example: Replace array with its square:
IndexIterator iter = A.getIndexIterator(); while (iter.hasNext()) { double val = iter.getDoubleNext(); iter.setDoubleCurrent(val * val); }
Note that canonical order may not be physical order.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
getBooleanCurrent()
Get current value as a booleanboolean
getBooleanNext()
Get next value as a booleanbyte
getByteCurrent()
Get current value as a bytebyte
getByteNext()
Get next value as a bytechar
getCharCurrent()
Get current value as a charchar
getCharNext()
Get next value as a charint[]
getCurrentCounter()
Get the current counter, use for debuggingdouble
getDoubleCurrent()
Get current value as a doubledouble
getDoubleNext()
Get next value as a doublefloat
getFloatCurrent()
Get current value as a floatfloat
getFloatNext()
Get next value as a floatint
getIntCurrent()
Get current value as a intint
getIntNext()
Get next value as a intlong
getLongCurrent()
Get current value as a longlong
getLongNext()
Get next value as a longObject
getObjectCurrent()
Get current value as a ObjectObject
getObjectNext()
Get next value as an Objectshort
getShortCurrent()
Get current value as a shortshort
getShortNext()
Get next value as a shortboolean
hasNext()
Return true if there are more elements in the iteration.Object
next()
Get next value as an Objectvoid
setBooleanCurrent(boolean val)
Set current value with a booleanvoid
setBooleanNext(boolean val)
Set next value with a booleanvoid
setByteCurrent(byte val)
Set current value with a bytevoid
setByteNext(byte val)
Set next value with a bytevoid
setCharCurrent(char val)
Set current value with a charvoid
setCharNext(char val)
Set next value with a charvoid
setDoubleCurrent(double val)
Set current value with a doublevoid
setDoubleNext(double val)
Set next value with a doublevoid
setFloatCurrent(float val)
Set current value with a floatvoid
setFloatNext(float val)
Set next value with a floatvoid
setIntCurrent(int val)
Set current value with a intvoid
setIntNext(int val)
Set next value with a intvoid
setLongCurrent(long val)
Set current value with a longvoid
setLongNext(long val)
Set next value with a longvoid
setObjectCurrent(Object val)
Set current value with a Objectvoid
setObjectNext(Object val)
Set next value with a Objectvoid
setShortCurrent(short val)
Set current value with a shortvoid
setShortNext(short val)
Set next value with a short
-
-
-
Method Detail
-
hasNext
boolean hasNext()
Return true if there are more elements in the iteration.- Returns:
- true if there are more elements in the iteration.
-
getDoubleNext
double getDoubleNext()
Get next value as a double- Returns:
- next value as a double
-
setDoubleNext
void setDoubleNext(double val)
Set next value with a double- Parameters:
val
- the next value as a double
-
getDoubleCurrent
double getDoubleCurrent()
Get current value as a double- Returns:
- current value as a double
-
setDoubleCurrent
void setDoubleCurrent(double val)
Set current value with a double- Parameters:
val
- the current value as a double
-
getFloatNext
float getFloatNext()
Get next value as a float- Returns:
- next value as a float
-
setFloatNext
void setFloatNext(float val)
Set next value with a float- Parameters:
val
- the next value as a float
-
getFloatCurrent
float getFloatCurrent()
Get current value as a float- Returns:
- current value as a float
-
setFloatCurrent
void setFloatCurrent(float val)
Set current value with a float- Parameters:
val
- the current value as a float
-
getLongNext
long getLongNext()
Get next value as a long- Returns:
- next value as a long
-
setLongNext
void setLongNext(long val)
Set next value with a long- Parameters:
val
- the next value as a long
-
getLongCurrent
long getLongCurrent()
Get current value as a long- Returns:
- current value as a long
-
setLongCurrent
void setLongCurrent(long val)
Set current value with a long- Parameters:
val
- the current value as a long
-
getIntNext
int getIntNext()
Get next value as a int- Returns:
- next value as a int
-
setIntNext
void setIntNext(int val)
Set next value with a int- Parameters:
val
- the next value as a int
-
getIntCurrent
int getIntCurrent()
Get current value as a int- Returns:
- current value as a int
-
setIntCurrent
void setIntCurrent(int val)
Set current value with a int- Parameters:
val
- the current value as a int
-
getShortNext
short getShortNext()
Get next value as a short- Returns:
- next value as a short
-
setShortNext
void setShortNext(short val)
Set next value with a short- Parameters:
val
- the next value as a short
-
getShortCurrent
short getShortCurrent()
Get current value as a short- Returns:
- current value as a short
-
setShortCurrent
void setShortCurrent(short val)
Set current value with a short- Parameters:
val
- the current value as a short
-
getByteNext
byte getByteNext()
Get next value as a byte- Returns:
- next value as a byte
-
setByteNext
void setByteNext(byte val)
Set next value with a byte- Parameters:
val
- the next value as a byte
-
getByteCurrent
byte getByteCurrent()
Get current value as a byte- Returns:
- current value as a byte
-
setByteCurrent
void setByteCurrent(byte val)
Set current value with a byte- Parameters:
val
- the current value as a byte
-
getCharNext
char getCharNext()
Get next value as a char- Returns:
- next value as a char
-
setCharNext
void setCharNext(char val)
Set next value with a char- Parameters:
val
- the next value as a char
-
getCharCurrent
char getCharCurrent()
Get current value as a char- Returns:
- current value as a char
-
setCharCurrent
void setCharCurrent(char val)
Set current value with a char- Parameters:
val
- the current value as a char
-
getBooleanNext
boolean getBooleanNext()
Get next value as a boolean- Returns:
- next value as a boolean
-
setBooleanNext
void setBooleanNext(boolean val)
Set next value with a boolean- Parameters:
val
- the next value as a boolean
-
getBooleanCurrent
boolean getBooleanCurrent()
Get current value as a boolean- Returns:
- current value as a boolean
-
setBooleanCurrent
void setBooleanCurrent(boolean val)
Set current value with a boolean- Parameters:
val
- the current value as a boolean
-
getObjectNext
Object getObjectNext()
Get next value as an Object- Returns:
- next value as an Object
-
setObjectNext
void setObjectNext(Object val)
Set next value with a Object- Parameters:
val
- the next value as a Object
-
getObjectCurrent
Object getObjectCurrent()
Get current value as a Object- Returns:
- current value as a Object
-
setObjectCurrent
void setObjectCurrent(Object val)
Set current value with a Object- Parameters:
val
- the current value as a Object
-
next
Object next()
Get next value as an Object- Returns:
- next value as an Object
-
getCurrentCounter
int[] getCurrentCounter()
Get the current counter, use for debugging- Returns:
- the current counter, use for debugging
-
-