Class ListeningEvent
java.lang.Object
yearreview.app.data.sources.audio.database.ListeningEvent
- All Implemented Interfaces:
Comparable<ListeningEvent>
An Event that represents a
piece
that was listened to at a certain time.- Author:
- ColdStone37
-
Field Summary
Modifier and TypeFieldDescriptionfinal Duration
Duration of listening.final AudioPiece
Piece that was listened to.final Instant
Time the piece was listened to. -
Constructor Summary
ConstructorDescriptionListeningEvent
(AudioPiece listenedTo, Instant time, Duration duration) Constructs a new ListeningEvent. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ListeningEvent other) Compares two ListeningEvents by theirtime
.
-
Field Details
-
listenedTo
Piece that was listened to. -
time
Time the piece was listened to. -
duration
Duration of listening.
-
-
Constructor Details
-
ListeningEvent
Constructs a new ListeningEvent.- Parameters:
listenedTo
- piece that was listened totime
- time at which it was listenedduration
- duration of listening
-
-
Method Details
-
compareTo
Compares two ListeningEvents by theirtime
. Needed to implement theComparable
-interface.- Specified by:
compareTo
in interfaceComparable<ListeningEvent>
- Parameters:
other
- event to compare against- Returns:
- negative value if this event is before the other event. Zero if the events were at the same time. Positive value otherwise
-