Package org.apache.commons.math.util
Class MultidimensionalCounter.Iterator
- java.lang.Object
-
- org.apache.commons.math.util.MultidimensionalCounter.Iterator
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Integer>
- Enclosing class:
- MultidimensionalCounter
public class MultidimensionalCounter.Iterator extends java.lang.Object implements java.util.Iterator<java.lang.Integer>Perform iteration over the multidimensional counter.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCount()Get the current unidimensional counter slot.intgetCount(int dim)Get the current count in the selected dimension.int[]getCounts()Get the current multidimensional counter slots.booleanhasNext()java.lang.Integernext()voidremove()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<java.lang.Integer>
-
next
public java.lang.Integer next()
- Specified by:
nextin interfacejava.util.Iterator<java.lang.Integer>- Returns:
- the unidimensional count after the counter has been
incremented by
1.
-
getCount
public int getCount()
Get the current unidimensional counter slot.- Returns:
- the index within the unidimensionl counter.
-
getCounts
public int[] getCounts()
Get the current multidimensional counter slots.- Returns:
- the indices within the multidimensional counter.
-
getCount
public int getCount(int dim)
Get the current count in the selected dimension.- Parameters:
dim- Dimension index.- Returns:
- the count at the corresponding index for the current state of the iterator.
- Throws:
java.lang.IndexOutOfBoundsException- ifindexis not in the correct interval (as defined by the length of the argument in theconstructor of the enclosing class).
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<java.lang.Integer>- Throws:
java.lang.UnsupportedOperationException
-
-