Class AudioTopListAdapter
java.lang.Object
yearreview.app.data.sources.audio.database.AudioTopListAdapter
- All Implemented Interfaces:
TopListAdapter
An Adapter that transforms the data stored in an
database
so it can be processed by a TopListGenerator
.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map<AudioData,
TopListElement> Maps all AudioData object to their associated TopListElements.private ListeningEvent
Events that is currently processed.private Duration
Duration of theevent
that was already added to theTopListElement
.private final AudioDatabase
Database to adapt for the TopList.private final Iterator<ListeningEvent>
private final AudioData.Type
Type of data passed to theTopListGenerator
. -
Constructor Summary
ConstructorDescriptionAudioTopListAdapter
(AudioDatabase database, AudioData.Type type) Constructs a AudioTopListAdapter from a given database andAudioData.Type
to get theDuraitonValues
for. -
Method Summary
Modifier and TypeMethodDescriptionGets the Elements of the TopList with their values at a certain time.
-
Field Details
-
database
Database to adapt for the TopList. -
type
Type of data passed to theTopListGenerator
. -
eventIterator
-
currentEvent
Events that is currently processed. -
currentEventListeningDuration
Duration of theevent
that was already added to theTopListElement
. -
audioMap
Maps all AudioData object to their associated TopListElements.
-
-
Constructor Details
-
AudioTopListAdapter
Constructs a AudioTopListAdapter from a given database andAudioData.Type
to get theDuraitonValues
for.- Parameters:
database
- database to get the data fromtype
- type of data to filter by
-
-
Method Details
-
getElements
Gets the Elements of the TopList with their values at a certain time.- Specified by:
getElements
in interfaceTopListAdapter
- Parameters:
t
- time until which all values should be added up to- Returns:
- elements with their associated
values
-