Interface BaseQueue<T>



  • public interface BaseQueue<T>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      void add(T object)
      Adds an object to the queue
      void clear()
      Removes all objects from the queue
      T peek()
      Gets the first item from the queue, or null if the queue is empty
      java.util.List<T> peek(int max)
      Gets the first n items from the queue, or all if there are less than n items
      void remove(int max)
      Removes n objects from the queue, or all if there are less than n items
      int size()
      Gets the current queue size
    • Method Detail

      • add

        void add(T object)
        Adds an object to the queue
        Parameters:
        object - the object to be added to the queue
      • size

        int size()
        Gets the current queue size
        Returns:
        the size of the queue
      • peek

        T peek()
        Gets the first item from the queue, or null if the queue is empty
        Returns:
        the first item from the queue, or null
      • peek

        java.util.List<T> peek(int max)
        Gets the first n items from the queue, or all if there are less than n items
        Parameters:
        max - the maximum number of items to return
        Returns:
        the list of items retrieved from the queue
      • remove

        void remove(int max)
        Removes n objects from the queue, or all if there are less than n items
        Parameters:
        max - the maximum number of items to return
      • clear

        void clear()
        Removes all objects from the queue