Class FitnessAdapter
java.lang.Object
yearreview.app.data.sources.fitness.adapters.FitnessAdapter
- Direct Known Subclasses:
StravaAdapter
Abstract class that defines how an adapter to a
FitnessDatabase should work.- Author:
- ColdStone37
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FitnessDatabaseDatabase to insert the data into. -
Constructor Summary
ConstructorsConstructorDescriptionFitnessAdapter(FitnessDatabase database) Constructs a FitnessAdapter given a database to use for inserting the data -
Method Summary
Modifier and TypeMethodDescriptionstatic FitnessAdaptergetAdapter(FitnessDatabase database, XmlNode config) Static function to get an adapter by its nameabstract voidFunction that loads the data into theFitnessDatabase.
-
Field Details
-
database
Database to insert the data into.
-
-
Constructor Details
-
FitnessAdapter
Constructs a FitnessAdapter given a database to use for inserting the data- Parameters:
database- database to insert the data into
-
-
Method Details
-
getAdapter
Static function to get an adapter by its name- Parameters:
database- database to use for inserting the dataconfig- configuration file for the adapter- Returns:
- the adapter or null if an adapter with the given name does not exist
-
loadData
Function that loads the data into theFitnessDatabase.- Parameters:
start- start time of data to loadend- end time of data to load- Throws:
IOException- if the all or some of the files cannot be read
-