Class FitnessDataSource
java.lang.Object
java.lang.Thread
yearreview.app.data.sources.DataSource
yearreview.app.data.sources.fitness.FitnessDataSource
- All Implemented Interfaces:
Runnable
A
DataSource that loads the Fitness Data exported from services like Strava using adapters.- Author:
- ColdStone37
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<FitnessAdapter>List of adapters to use for loading data.private FitnessDatabaseDatabase to store the activities in.private static final LoggerFields inherited from class yearreview.app.data.sources.DataSource
tagFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a FitnessDataSource using a configuration. -
Method Summary
Modifier and TypeMethodDescriptionGets a TopListAdapter for the Database that allows for creation of TopLists using theTopListGenerator.voidLoads the data from theadapters.voidparseConfig(XmlNode config) Parses the configuration and initializes the adapters.Methods inherited from class yearreview.app.data.sources.DataSource
getDataSource, runMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
adapters
List of adapters to use for loading data. -
database
Database to store the activities in. -
logger
-
-
Constructor Details
-
FitnessDataSource
Constructs a FitnessDataSource using a configuration.- Parameters:
c- configuration of the DataSource
-
-
Method Details
-
parseConfig
Parses the configuration and initializes the adapters.- Specified by:
parseConfigin classDataSource- Parameters:
config- configuration to parse
-
loadData
Loads the data from theadapters.- Specified by:
loadDatain classDataSource- Parameters:
start- start time for Activities to considerend- end time for Activities to consider- Throws:
IOException- if some files cannot be loaded
-
getTopListAdapter
Gets a TopListAdapter for the Database that allows for creation of TopLists using theTopListGenerator.- Returns:
- Adapter to create TopLists from the Database
-