public class IndexListDataSetIterator extends java.lang.Object implements DataSetIterator
Constructor and Description |
---|
IndexListDataSetIterator(QDataSet indeces)
Create the iterator
|
Modifier and Type | Method and Description |
---|---|
DDataSet |
createEmptyDs()
return a dataset that will have the same geometry at the
dataset implied by each dimension iterator.
|
QDataSet |
getRank0Value(QDataSet ds)
get the rank 0 data set the current iterator position.
|
double |
getValue(QDataSet ds)
get the value from ds at the current iterator position.
|
boolean |
hasNext()
return true while the iterator has a next element.
|
int |
index(int dim)
return the current index for the dimension.
|
int |
length(int dim)
return the length of the dimension, or the length reported by the
iterator.
|
void |
next()
iterate to the next position.
|
void |
putRank0Value(WritableDataSet ds,
QDataSet vds)
replace the value in ds at the current iterator position.
|
void |
putValue(WritableDataSet ds,
double v)
replace the value in ds at the current iterator position.
|
int |
rank()
return the rank of the dataset which the iterator will walk through.
|
java.lang.String |
toString() |
public IndexListDataSetIterator(QDataSet indeces)
indeces
- rank 2 indeces [npoints,rank] or just [npoints] for rank 1 data.public boolean hasNext()
DataSetIterator
hasNext
in interface DataSetIterator
public int index(int dim)
DataSetIterator
index
in interface DataSetIterator
dim
- the dimension number (0<=dim<inputRank)public int length(int dim)
DataSetIterator
length
in interface DataSetIterator
dim
- the dimension number (0<=dim<inputRank)public void next()
DataSetIterator
next
in interface DataSetIterator
public int rank()
DataSetIterator
rank
in interface DataSetIterator
public QDataSet getRank0Value(QDataSet ds)
DataSetIterator
getRank0Value
in interface DataSetIterator
public final double getValue(QDataSet ds)
getValue
in interface DataSetIterator
ds
- a dataset with compatible geometry as the iterator's geometry.public final void putValue(WritableDataSet ds, double v)
putValue
in interface DataSetIterator
ds
- a writable dataset with compatible geometry as the iterator's geometry.v
- the value to insert.public void putRank0Value(WritableDataSet ds, QDataSet vds)
DataSetIterator
putRank0Value
in interface DataSetIterator
ds
- a writable dataset with compatible geometry as the iterator's geometry.vds
- the rank 0 value to insertpublic java.lang.String toString()
toString
in class java.lang.Object
public DDataSet createEmptyDs()
DataSetIterator
createEmptyDs
in interface DataSetIterator
QubeDataSetIterator.createEmptyDs()