Class PlaylistQueue

java.lang.Object
com.reign.kat.lib.voice.newvoice.PlaylistQueue

public class PlaylistQueue extends Object
FIFO queue for RequestedTracks, which also supports shuffling and moving elements.
  • Field Details

  • Constructor Details

  • Method Details

    • enqueue

      public void enqueue(RequestedTrack track)
      Add a RequestedTrack to the end of the queue.
      Parameters:
      track - Track to add.
    • enqueueFront

      public void enqueueFront(RequestedTrack track)
    • search

      public List<RequestedTrack> search(net.dv8tion.jda.api.entities.Member m, String q)
    • dequeue

      public RequestedTrack dequeue()
      Pops from the front of the queue.
      Returns:
      RequestedTrack which was first in the queue.
    • peek

      public RequestedTrack peek()
      Returns the next track without removing it from the queue
    • getQueue

      public List<RequestedTrack> getQueue()
    • shuffle

      public void shuffle()
      Shuffles the queue randomly.
    • move

      public void move(int a, int b) throws IndexOutOfBoundsException
      Moves the track at index a to index b.
      Parameters:
      a - Index to be moved.
      b - Index to move to.
      Throws:
      IndexOutOfBoundsException
    • size

      public int size()
    • clear

      public void clear()
      Clears the playlist.