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
FieldsModifier and TypeFieldDescriptionprivate final Map<AudioData,TopListElement> Maps all AudioData object to their associated TopListElements.private ListeningEventEvents that is currently processed.private DurationDuration of theeventthat was already added to theTopListElement.private final AudioDatabaseDatabase to adapt for the TopList.private final Iterator<ListeningEvent>private final AudioData.TypeType of data passed to theTopListGenerator. -
Constructor Summary
ConstructorsConstructorDescriptionAudioTopListAdapter(AudioDatabase database, AudioData.Type type) Constructs a AudioTopListAdapter from a given database andAudioData.Typeto get theDuraitonValuesfor. -
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 theeventthat 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.Typeto get theDuraitonValuesfor.- 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:
getElementsin interfaceTopListAdapter- Parameters:
t- time until which all values should be added up to- Returns:
- elements with their associated
values
-