Class TopSongQueue

java.lang.Object
org.localify.playlist.TopSongQueue

public class TopSongQueue extends Object
A queue for managing a list of top songs.
  • Constructor Details

    • TopSongQueue

      public TopSongQueue(List<Song> songs, int topThreshold)
      Constructs a new TopSongQueue.
      Parameters:
      songs - The list of songs.
      topThreshold - The threshold for considering a song as "top".
  • Method Details

    • pollTopSongPopularity

      public Song pollTopSongPopularity()
      Polls a top song from the queue based on popularity.
      Returns:
      A top song, or null if the queue is empty.
    • pollTopSongAcoustics

      public Song pollTopSongAcoustics(Song seedSong)
      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.