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
FieldsModifier and TypeFieldDescriptionfinal DurationDuration of listening.final AudioPiecePiece that was listened to.final InstantTime the piece was listened to. -
Constructor Summary
ConstructorsConstructorDescriptionListeningEvent(AudioPiece listenedTo, Instant time, Duration duration) Constructs a new ListeningEvent. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(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:
compareToin 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
-