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() |
public int index
public IndexIterator()
public abstract boolean hasNext()
public abstract int[] getPos()
public abstract void reset()
public int[] getShape()
Copyright © 2017. All rights reserved.