Package uk.ac.rdg.resc.edal.dataset
Interface DiscreteFeatureReader<F extends DiscreteFeature<?,?>>
-
- Type Parameters:
F
- The concrete type of theDiscreteFeature
to be read by thisDiscreteFeatureReader
public interface DiscreteFeatureReader<F extends DiscreteFeature<?,?>>
Defines an interface for readingDiscreteFeature
s. This is used for reading features from a collection (usually anAbstractContinuousDomainDataset
) where the primary method of referencing them is by their ID.- Author:
- Guy Griffiths
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description F
readFeature(String id, Set<String> variableIds)
Reads aDiscreteFeature
from the underlying data source.List<F>
readFeatures(Collection<String> ids, Set<String> variableIds)
ReadsDiscreteFeature
s from the underlying data source.
-
-
-
Method Detail
-
readFeature
F readFeature(String id, Set<String> variableIds) throws DataReadingException
Reads aDiscreteFeature
from the underlying data source. This method should be used when only a single feature needs to be read. For multiple features it is recommended to use thereadFeatures(Collection, Set)
method since invoking this method multiple times may result in a large amount of overhead re-opening and closing data files.- Parameters:
id
- The identifier of the feature within its collection.variableIds
- The variables which must be included in the feature. Additional variables can be present if this is more convenient (i.e. if entire features are already stored in memory there is no need to subset them to exclude unwanted variables). If this argument isnull
then all available variables should be included- Returns:
- A
DiscreteFeature
containing measurements for all of the supplied variables. - Throws:
DataReadingException
-
readFeatures
List<F> readFeatures(Collection<String> ids, Set<String> variableIds) throws DataReadingException
ReadsDiscreteFeature
s from the underlying data source.- Parameters:
ids
- The identifier of the features within their collection.variableIds
- The variables which must be included in the feature. Additional variables can be present if this is more convenient (i.e. if entire features are already stored in memory there is no need to subset them to exclude unwanted variables). If this argument isnull
then all available variables should be included- Returns:
- A
List
ofDiscreteFeature
s containing measurements for all of the supplied variables. - Throws:
DataReadingException
-
-