Interface Queue<I extends Item>

All Known Implementing Classes:
SynchronizedQueue

public interface Queue<I extends Item>
The queue needed by the concurrent FIFO cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(I item)
    Add the item to the head of the list.
    boolean
    remove(I item)
    Attempt to remove an item from the queue.
    int
    Returns the queue size
    trim(int size)
    Attempt to trim the queue.
  • Method Details

    • size

      int size()
      Returns the queue size
      Returns:
      the size
    • remove

      boolean remove(I item)
      Attempt to remove an item from the queue.
      Parameters:
      item - the item to remove
      Returns:
      true if the item was removed by this thread
    • add

      void add(I item)
      Add the item to the head of the list.
      Parameters:
      item - the item to add
    • trim

      ArrayList<I> trim(int size)
      Attempt to trim the queue. Trim will occur if no other thread is already performing a trim and the queue size is greater than the provided size.
      Parameters:
      size - the wanted size
      Returns:
      the list of evicted items