Package ucar.ma2
Interface IndexIterator
-
- All Known Implementing Classes:
IteratorFast
public interface IndexIteratorIteration 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 booleangetBooleanCurrent()Get current value as a booleanbooleangetBooleanNext()Get next value as a booleanbytegetByteCurrent()Get current value as a bytebytegetByteNext()Get next value as a bytechargetCharCurrent()Get current value as a charchargetCharNext()Get next value as a charint[]getCurrentCounter()Get the current counter, use for debuggingdoublegetDoubleCurrent()Get current value as a doubledoublegetDoubleNext()Get next value as a doublefloatgetFloatCurrent()Get current value as a floatfloatgetFloatNext()Get next value as a floatintgetIntCurrent()Get current value as a intintgetIntNext()Get next value as a intlonggetLongCurrent()Get current value as a longlonggetLongNext()Get next value as a longObjectgetObjectCurrent()Get current value as a ObjectObjectgetObjectNext()Get next value as an ObjectshortgetShortCurrent()Get current value as a shortshortgetShortNext()Get next value as a shortbooleanhasNext()Return true if there are more elements in the iteration.Objectnext()Get next value as an ObjectvoidsetBooleanCurrent(boolean val)Set current value with a booleanvoidsetBooleanNext(boolean val)Set next value with a booleanvoidsetByteCurrent(byte val)Set current value with a bytevoidsetByteNext(byte val)Set next value with a bytevoidsetCharCurrent(char val)Set current value with a charvoidsetCharNext(char val)Set next value with a charvoidsetDoubleCurrent(double val)Set current value with a doublevoidsetDoubleNext(double val)Set next value with a doublevoidsetFloatCurrent(float val)Set current value with a floatvoidsetFloatNext(float val)Set next value with a floatvoidsetIntCurrent(int val)Set current value with a intvoidsetIntNext(int val)Set next value with a intvoidsetLongCurrent(long val)Set current value with a longvoidsetLongNext(long val)Set next value with a longvoidsetObjectCurrent(Object val)Set current value with a ObjectvoidsetObjectNext(Object val)Set next value with a ObjectvoidsetShortCurrent(short val)Set current value with a shortvoidsetShortNext(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
-
-