Class AudioDataSource
java.lang.Object
java.lang.Thread
yearreview.app.data.sources.DataSource
yearreview.app.data.sources.audio.AudioDataSource
- All Implemented Interfaces:
Runnable
A
DataSource that uses adapters to load the listening-history from files exported from services like Spotify.- Author:
- ColdStone37
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<AudioDatabaseAdapter>Adapters used for loading the listening histories.private AudioDatabaseDatabase to store the data in.Fields inherited from class yearreview.app.data.sources.DataSource
logger, tagFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new AudioDataSource from a given configuration. -
Method Summary
Modifier and TypeMethodDescriptionGets the TopListAdapter for theAudioDatabasethat can be used to create a TopList from thisDataSource.voidLoads the data from theadapters.voidparseConfig(XmlNode config) Parses the passed configuration, initializes the databse and creates 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
Adapters used for loading the listening histories. -
database
Database to store the data in.
-
-
Constructor Details
-
AudioDataSource
Constructs a new AudioDataSource from a given configuration.- Parameters:
c- configuration to use
-
-
Method Details
-
parseConfig
Parses the passed configuration, initializes the databse and creates the adapters.- Specified by:
parseConfigin classDataSource- Parameters:
config- configuration to parse
-
loadData
Loads the data from theadapters.- Specified by:
loadDatain classDataSource- Parameters:
start- start of interval to load data fromend- end of interval to load data from- Throws:
IOException- if the data cannot be loaded
-
getTopListAdapter
Gets the TopListAdapter for theAudioDatabasethat can be used to create a TopList from thisDataSource.- Parameters:
type- type of data to filter the TopList by- Returns:
- adapter for the TopList
-