public abstract class IndexIterator extends Object
Class to provide iteration through whole data array that backs a dataset
Instantiate an iterator and use it in a while loop:
DoubleDataset ds = DatasetFactory.createLinearSpace(DoubleDataset.class, 0, 10, 0.25); IndexIterator iter = ds.getIterator(); double[] data = ds.getData(); while (iter.hasNext()) { data[iter.index] = 1.2; }
Modifier and Type | Field and Description |
---|---|
int |
index
Index in array
|
Constructor and Description |
---|
IndexIterator() |
Modifier and Type | Method and Description |
---|---|
abstract int[] |
getPos() |
int[] |
getShape() |
abstract boolean |
hasNext() |
abstract void |
reset()
Reset iterator
|
public int index
public IndexIterator()
public abstract boolean hasNext()
public abstract int[] getPos()
public abstract void reset()
public int[] getShape()
Copyright © 2014–2022 Eclipse Foundation. All rights reserved.