Class AudioDatabaseAdapter
java.lang.Object
yearreview.app.data.sources.audio.adapter.AudioDatabaseAdapter
- Direct Known Subclasses:
SpotifyAdapter
Abstract class that defines how an adapter to an
AudioDatabase
should work.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AudioDatabase
Stores the database to insert the data into. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AudioDatabaseAdapter
getAdapter
(AudioDatabase database, XmlNode config) Creates a new Adapter by its name.abstract void
Loads the data of the Adapter and inserts it into the database.
-
Field Details
-
database
Stores the database to insert the data into.
-
-
Constructor Details
-
AudioDatabaseAdapter
Constructs an adapter. A database must always be passed since it's needed to insert the data.- Parameters:
database
- database to insert the data into
-
-
Method Details
-
getAdapter
Creates a new Adapter by its name.- Parameters:
database
- database to insert the data of the Adapter intoconfig
- configuration for the Adapter- Returns:
- the constructed Adapter
-
loadData
Loads the data of the Adapter and inserts it into the database.- 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
-