Package uk.ac.starlink.ttools.plot2.data
Class StepDataStore
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.data.StepDataStore
-
-
Constructor Summary
Constructors Constructor Description StepDataStore(DataStore base, int step)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TupleRunner
getTupleRunner()
Returns an object that manages iteration over tuples.TupleSequence
getTupleSequence(DataSpec spec)
Returns the data described by a given DataSpec as a sequence of tuples.boolean
hasData(DataSpec spec)
Indicates whether this store has the data described by a given DataSpec.
-
-
-
Constructor Detail
-
StepDataStore
public StepDataStore(DataStore base, int step)
Constructor.- Parameters:
base
- base data store to which most behaviour is delegatedstep
- stride indicating the size of the subsample; step=1 means all rows, step=2 means every other one etc
-
-
Method Detail
-
getTupleSequence
public TupleSequence getTupleSequence(DataSpec spec)
Description copied from interface:DataStore
Returns the data described by a given DataSpec as a sequence of tuples. Must only be called ifDataStore.hasData(uk.ac.starlink.ttools.plot2.data.DataSpec)
returns true for the given DataSpec; if not, behaviour is undefined.- Specified by:
getTupleSequence
in interfaceDataStore
- Parameters:
spec
- plot data specification object- Returns:
- sequence of values which can be used to perform a plot
-
hasData
public boolean hasData(DataSpec spec)
Description copied from interface:DataStore
Indicates whether this store has the data described by a given DataSpec.
-
getTupleRunner
public TupleRunner getTupleRunner()
Description copied from interface:DataStore
Returns an object that manages iteration over tuples. Where possible, the returned TupleRunner should be used for iteration when using this DataStore, since it contains the chosen policy for parallel execution. If only sequential processing is supported however, TupleSequences acquired from this store can be used directly.- Specified by:
getTupleRunner
in interfaceDataStore
- Returns:
- tuple runner
-
-