Package ucar.ma2
Class IteratorFast
- java.lang.Object
-
- ucar.ma2.IteratorFast
-
- All Implemented Interfaces:
IndexIterator
public class IteratorFast extends Object implements IndexIterator
A "fast" iterator that can be used when the data is in canonical order.
-
-
Method Summary
All Methods Instance Methods Concrete 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
hasMore(int howMany)
boolean
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 shortString
toString()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:IndexIterator
Return true if there are more elements in the iteration.- Specified by:
hasNext
in interfaceIndexIterator
- Returns:
- true if there are more elements in the iteration.
-
hasMore
public boolean hasMore(int howMany)
-
getCurrentCounter
public int[] getCurrentCounter()
Description copied from interface:IndexIterator
Get the current counter, use for debugging- Specified by:
getCurrentCounter
in interfaceIndexIterator
- Returns:
- the current counter, use for debugging
-
getDoubleCurrent
public double getDoubleCurrent()
Description copied from interface:IndexIterator
Get current value as a double- Specified by:
getDoubleCurrent
in interfaceIndexIterator
- Returns:
- current value as a double
-
getDoubleNext
public double getDoubleNext()
Description copied from interface:IndexIterator
Get next value as a double- Specified by:
getDoubleNext
in interfaceIndexIterator
- Returns:
- next value as a double
-
setDoubleCurrent
public void setDoubleCurrent(double val)
Description copied from interface:IndexIterator
Set current value with a double- Specified by:
setDoubleCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a double
-
setDoubleNext
public void setDoubleNext(double val)
Description copied from interface:IndexIterator
Set next value with a double- Specified by:
setDoubleNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a double
-
getFloatCurrent
public float getFloatCurrent()
Description copied from interface:IndexIterator
Get current value as a float- Specified by:
getFloatCurrent
in interfaceIndexIterator
- Returns:
- current value as a float
-
getFloatNext
public float getFloatNext()
Description copied from interface:IndexIterator
Get next value as a float- Specified by:
getFloatNext
in interfaceIndexIterator
- Returns:
- next value as a float
-
setFloatCurrent
public void setFloatCurrent(float val)
Description copied from interface:IndexIterator
Set current value with a float- Specified by:
setFloatCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a float
-
setFloatNext
public void setFloatNext(float val)
Description copied from interface:IndexIterator
Set next value with a float- Specified by:
setFloatNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a float
-
getLongCurrent
public long getLongCurrent()
Description copied from interface:IndexIterator
Get current value as a long- Specified by:
getLongCurrent
in interfaceIndexIterator
- Returns:
- current value as a long
-
getLongNext
public long getLongNext()
Description copied from interface:IndexIterator
Get next value as a long- Specified by:
getLongNext
in interfaceIndexIterator
- Returns:
- next value as a long
-
setLongCurrent
public void setLongCurrent(long val)
Description copied from interface:IndexIterator
Set current value with a long- Specified by:
setLongCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a long
-
setLongNext
public void setLongNext(long val)
Description copied from interface:IndexIterator
Set next value with a long- Specified by:
setLongNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a long
-
getIntCurrent
public int getIntCurrent()
Description copied from interface:IndexIterator
Get current value as a int- Specified by:
getIntCurrent
in interfaceIndexIterator
- Returns:
- current value as a int
-
getIntNext
public int getIntNext()
Description copied from interface:IndexIterator
Get next value as a int- Specified by:
getIntNext
in interfaceIndexIterator
- Returns:
- next value as a int
-
setIntCurrent
public void setIntCurrent(int val)
Description copied from interface:IndexIterator
Set current value with a int- Specified by:
setIntCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a int
-
setIntNext
public void setIntNext(int val)
Description copied from interface:IndexIterator
Set next value with a int- Specified by:
setIntNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a int
-
getShortCurrent
public short getShortCurrent()
Description copied from interface:IndexIterator
Get current value as a short- Specified by:
getShortCurrent
in interfaceIndexIterator
- Returns:
- current value as a short
-
getShortNext
public short getShortNext()
Description copied from interface:IndexIterator
Get next value as a short- Specified by:
getShortNext
in interfaceIndexIterator
- Returns:
- next value as a short
-
setShortCurrent
public void setShortCurrent(short val)
Description copied from interface:IndexIterator
Set current value with a short- Specified by:
setShortCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a short
-
setShortNext
public void setShortNext(short val)
Description copied from interface:IndexIterator
Set next value with a short- Specified by:
setShortNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a short
-
getByteCurrent
public byte getByteCurrent()
Description copied from interface:IndexIterator
Get current value as a byte- Specified by:
getByteCurrent
in interfaceIndexIterator
- Returns:
- current value as a byte
-
getByteNext
public byte getByteNext()
Description copied from interface:IndexIterator
Get next value as a byte- Specified by:
getByteNext
in interfaceIndexIterator
- Returns:
- next value as a byte
-
setByteCurrent
public void setByteCurrent(byte val)
Description copied from interface:IndexIterator
Set current value with a byte- Specified by:
setByteCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a byte
-
setByteNext
public void setByteNext(byte val)
Description copied from interface:IndexIterator
Set next value with a byte- Specified by:
setByteNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a byte
-
getCharCurrent
public char getCharCurrent()
Description copied from interface:IndexIterator
Get current value as a char- Specified by:
getCharCurrent
in interfaceIndexIterator
- Returns:
- current value as a char
-
getCharNext
public char getCharNext()
Description copied from interface:IndexIterator
Get next value as a char- Specified by:
getCharNext
in interfaceIndexIterator
- Returns:
- next value as a char
-
setCharCurrent
public void setCharCurrent(char val)
Description copied from interface:IndexIterator
Set current value with a char- Specified by:
setCharCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a char
-
setCharNext
public void setCharNext(char val)
Description copied from interface:IndexIterator
Set next value with a char- Specified by:
setCharNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a char
-
getBooleanCurrent
public boolean getBooleanCurrent()
Description copied from interface:IndexIterator
Get current value as a boolean- Specified by:
getBooleanCurrent
in interfaceIndexIterator
- Returns:
- current value as a boolean
-
getBooleanNext
public boolean getBooleanNext()
Description copied from interface:IndexIterator
Get next value as a boolean- Specified by:
getBooleanNext
in interfaceIndexIterator
- Returns:
- next value as a boolean
-
setBooleanCurrent
public void setBooleanCurrent(boolean val)
Description copied from interface:IndexIterator
Set current value with a boolean- Specified by:
setBooleanCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a boolean
-
setBooleanNext
public void setBooleanNext(boolean val)
Description copied from interface:IndexIterator
Set next value with a boolean- Specified by:
setBooleanNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a boolean
-
getObjectCurrent
public Object getObjectCurrent()
Description copied from interface:IndexIterator
Get current value as a Object- Specified by:
getObjectCurrent
in interfaceIndexIterator
- Returns:
- current value as a Object
-
getObjectNext
public Object getObjectNext()
Description copied from interface:IndexIterator
Get next value as an Object- Specified by:
getObjectNext
in interfaceIndexIterator
- Returns:
- next value as an Object
-
setObjectCurrent
public void setObjectCurrent(Object val)
Description copied from interface:IndexIterator
Set current value with a Object- Specified by:
setObjectCurrent
in interfaceIndexIterator
- Parameters:
val
- the current value as a Object
-
setObjectNext
public void setObjectNext(Object val)
Description copied from interface:IndexIterator
Set next value with a Object- Specified by:
setObjectNext
in interfaceIndexIterator
- Parameters:
val
- the next value as a Object
-
next
public Object next()
Description copied from interface:IndexIterator
Get next value as an Object- Specified by:
next
in interfaceIndexIterator
- Returns:
- next value as an Object
-
-