public class IndexCounter
extends java.lang.Object
Constructor and Description |
---|
IndexCounter(int[] dimensions)
Constructs this from a dimensions array.
|
IndexCounter(int[] dimensions,
int[] indices)
Constructs this from a dimensions array and a initial indices array.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getDimensions()
Retrieves the dimensions array.
|
int[] |
getIndices()
Retrieves the current indices array.
|
boolean |
incrementMany(int inc,
int... skipDims)
Increment multiple but skip the dimensions at the passed in skipDims.
|
boolean |
incrementOne(int... skipDims)
Increment one but skip the dimensions at the passed in skipDims.
|
public IndexCounter(int[] dimensions)
dimensions
- An array of dimensions.public IndexCounter(int[] dimensions, int[] indices)
dimensions
- An array of dimensions.indices
- An array of initial indices.public int[] getDimensions()
public int[] getIndices()
public boolean incrementMany(int inc, int... skipDims)
inc
- The count to increment.skipDims
- Ondices of the dimensions to skip.public boolean incrementOne(int... skipDims)
skipDims
- Indices of the dimensions to skip.