| Modifier and Type | Class and Description |
|---|---|
| public class | MultidimensionalCounter.
Perform iteration over the multidimensional counter. |
| Modifier and Type | Field and Description |
|---|---|
| private final int | dimension
Number of dimensions. |
| private final int | last
Index of last dimension. |
| private final int[] | size
Counter sizes. |
| private final int | totalSize
Total number of (one-dimensional) slots. |
| private final int[] | uniCounterOffset
Offset for each dimension. |
| Access | Constructor and Description |
|---|---|
| public | MultidimensionalCounter(int...
Counter sizes (number of slots in each dimension). size)Create a counter. |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the index within the unidimensionl counter.Indices in multidimensional counter. c)Convert to unidimensional counter. |
| public int[] | Returns: the multidimensional counts.Index in unidimensional counter. index)Convert to multidimensional counter. |
| public int | Returns: the number of dimensions.Get the number of dimensions of the multidimensional counter. |
| public int | |
| public int[] | Returns: the sizes of the multidimensional counter in each dimension.Get the number of multidimensional counter slots in each dimension. |
| public MultidimensionalCounter. | Returns: the iterator.Implements java. Create an iterator over this counter. |
| public String |
| dimension | back to summary |
|---|---|
| private final int dimension Number of dimensions. | |
| last | back to summary |
|---|---|
| private final int last Index of last dimension. | |
| size | back to summary |
|---|---|
| private final int[] size Counter sizes. | |
| totalSize | back to summary |
|---|---|
| private final int totalSize Total number of (one-dimensional) slots. | |
| uniCounterOffset | back to summary |
|---|---|
| private final int[] uniCounterOffset Offset for each dimension. | |
| MultidimensionalCounter | back to summary |
|---|---|
| public MultidimensionalCounter(int... size) throws NotStrictlyPositiveException Create a counter.
| |
| getCount | back to summary |
|---|---|
| public int getCount(int... c) throws OutOfRangeException, DimensionMismatchException Convert to unidimensional counter.
| |
| getCounts | back to summary |
|---|---|
| public int[] getCounts(int index) throws OutOfRangeException Convert to multidimensional counter.
| |
| getDimension | back to summary |
|---|---|
| public int getDimension() Get the number of dimensions of the multidimensional counter.
| |
| getSize | back to summary |
|---|---|
| public int getSize() Get the total number of elements.
| |
| getSizes | back to summary |
|---|---|
| public int[] getSizes() Get the number of multidimensional counter slots in each dimension.
| |
| iterator | back to summary |
|---|---|
| public MultidimensionalCounter. Implements java. Create an iterator over this counter.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private int | count
Unidimensional counter. |
| private final int[] | counter
Multidimensional counter. |
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the index within the unidimensionl counter.Get the current unidimensional counter slot. |
| public int | Returns: the count at the corresponding index for the current state of the iterator.Dimension index. dim)Get the current count in the selected dimension. |
| public int[] | Returns: the indices within the multidimensional counter.Get the current multidimensional counter slots. |
| public boolean | |
| public Integer | Returns: the unidimensional count after the counter has been incremented by1.Implements java. Returns the next element in the iteration. |
| public void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| count | back to summary |
|---|---|
| private int count Unidimensional counter. | |
| counter | back to summary |
|---|---|
| private final int[] counter Multidimensional counter. | |
| maxCount | back to summary |
|---|---|
| private final int maxCount Maximum value for | |
| Iterator | back to summary |
|---|---|
| pack-priv Iterator() Create an iterator
| |
| getCount | back to summary |
|---|---|
| public int getCount() Get the current unidimensional counter slot.
| |
| getCount | back to summary |
|---|---|
| public int getCount(int dim) Get the current count in the selected dimension.
| |
| getCounts | back to summary |
|---|---|
| public int[] getCounts() Get the current multidimensional counter slots.
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public Integer next() Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |