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
Modifier and TypeFieldDescriptionprivate List<FitnessAdapter>
List of adapters to use for loading data.private FitnessDatabase
Database to store the activities in.private static final Logger
Fields inherited from class yearreview.app.data.sources.DataSource
tag
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionConstructs a FitnessDataSource using a configuration. -
Method Summary
Modifier and TypeMethodDescriptionGets a TopListAdapter for the Database that allows for creation of TopLists using theTopListGenerator
.void
Loads the data from theadapters
.void
parseConfig
(XmlNode config) Parses the configuration and initializes the adapters.Methods inherited from class yearreview.app.data.sources.DataSource
getDataSource, run
Methods 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:
parseConfig
in classDataSource
- Parameters:
config
- configuration to parse
-
loadData
Loads the data from theadapters
.- Specified by:
loadData
in 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
-