Package org.localify.playlist
Class TopSongQueue
java.lang.Object
org.localify.playlist.TopSongQueue
A queue for managing a list of top songs.
-
Constructor Summary
ConstructorsConstructorDescriptionTopSongQueue(List<Song> songs, int topThreshold) Constructs a new TopSongQueue. -
Method Summary
Modifier and TypeMethodDescriptionpollTopSongAcoustics(Song seedSong) Polls a top song from the queue based on acoustic similarity to a seed song.Polls a top song from the queue based on popularity.intsize()Gets the size of the queue.
-
Constructor Details
-
TopSongQueue
Constructs a new TopSongQueue.- Parameters:
songs- The list of songs.topThreshold- The threshold for considering a song as "top".
-
-
Method Details
-
pollTopSongPopularity
Polls a top song from the queue based on popularity.- Returns:
- A top song, or null if the queue is empty.
-
pollTopSongAcoustics
Polls a top song from the queue based on acoustic similarity to a seed song.- Parameters:
seedSong- The seed song.- Returns:
- A top song, or null if no suitable song is found.
-
size
public int size()Gets the size of the queue.- Returns:
- The size of the queue.
-