public final class QubeDataSetIterator extends java.lang.Object implements DataSetIterator
| Modifier and Type | Class and Description |
|---|---|
static interface |
QubeDataSetIterator.DimensionIterator
DimensionIterator iterates over an index.
|
static interface |
QubeDataSetIterator.DimensionIteratorFactory
DimensionIteratorFactory creates DimensionIterators
|
static class |
QubeDataSetIterator.IndexListIterator
Iterator that goes through a list of indices.
|
static class |
QubeDataSetIterator.IndexListIteratorFactory
Factory for iterator that goes through a list of indices.
|
static class |
QubeDataSetIterator.SingletonIterator
Iterator for a single index.
|
static class |
QubeDataSetIterator.SingletonIteratorFactory
Factory for iterator for a single index, which can be negative indicating it is from the end of the array.
|
static class |
QubeDataSetIterator.StartStopStepIterator
Iterator for counting off indices.
|
static class |
QubeDataSetIterator.StartStopStepIteratorFactory
generates iterator for counting off indices.
|
| Constructor and Description |
|---|
QubeDataSetIterator(QDataSet ds)
dataset iterator to help in implementing the complex indexing
types of python.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
checkValidIndexList(QDataSet ds,
int indexSize) |
DDataSet |
createEmptyDs()
return a dataset that will have the same geometry at the
dataset implied by each dimension iterator.
|
static java.lang.String |
currentJythonLine()
return the current line in the Jython script as <filename>:<linenum>
or ??? if this cannot be done.
|
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()
true if there are more values.
|
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()
advance to the next index.
|
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.
|
void |
setIndexIteratorFactory(int dim,
QubeDataSetIterator.DimensionIteratorFactory fit)
reinitializes the iterator.
|
void |
setMonitor(ProgressMonitor mon)
convenient method for monitoring long processes, this allows
clients to let the iterator manage the monitor.
|
static QubeDataSetIterator |
sliceIterator(QDataSet ds,
int sliceIndex)
return an iterator for the slice of a dataset (on the 0th index).
|
java.lang.String |
toString() |
public QubeDataSetIterator(QDataSet ds)
ds - the dataset we will iterate over.public static java.lang.String currentJythonLine()
JythonOps#currentLine()public static void checkValidIndexList(QDataSet ds, int indexSize)
public void setMonitor(ProgressMonitor mon)
mon - the monitor, or null.public static QubeDataSetIterator sliceIterator(QDataSet ds, int sliceIndex)
ds - the dataset.sliceIndex - the index of the slice.QDataSet.slice(int)public void setIndexIteratorFactory(int dim,
QubeDataSetIterator.DimensionIteratorFactory fit)
dim - the dimension index (0,...,rank-1)fit - the iterator factory to use for the index.public boolean hasNext()
hasNext in interface DataSetIteratorpublic void next()
next in interface DataSetIteratorgetValue(org.das2.qds.QDataSet)public int index(int dim)
DataSetIteratorindex in interface DataSetIteratordim - the dimension number (0<=dim<inputRank)public int length(int dim)
DataSetIteratorlength in interface DataSetIteratordim - the dimension number (0<=dim<inputRank)public int rank()
DataSetIteratorrank in interface DataSetIteratorpublic java.lang.String toString()
toString in class java.lang.Objectpublic DDataSet createEmptyDs()
createEmptyDs in interface DataSetIteratorcreateEmptyDs()public final double getValue(QDataSet ds)
DataSetIteratorgetValue in interface DataSetIteratords - a dataset with compatible geometry as the iterator's geometry.public final QDataSet getRank0Value(QDataSet ds)
DataSetIteratorgetRank0Value in interface DataSetIteratorpublic final void putValue(WritableDataSet ds, double v)
DataSetIteratorputValue in interface DataSetIteratords - a writable dataset with compatible geometry as the iterator's geometry.v - the value to insert.public void putRank0Value(WritableDataSet ds, QDataSet vds)
DataSetIteratorputRank0Value in interface DataSetIteratords - a writable dataset with compatible geometry as the iterator's geometry.vds - the rank 0 value to insert