Interface IModifiableIdQueue<E extends IdBean>

Type Parameters:
E -
All Superinterfaces:
Collection<E>, Iterable<E>, Queue<E>
All Known Subinterfaces:
IPersistentModifiableIdQueue<E>
All Known Implementing Classes:
SynchronizedModifiableIdQueue

public interface IModifiableIdQueue<E extends IdBean> extends Queue<E>
A Queue that provides methods to allow the queue to be modified. Methods are provided that allow elements to be moved up (closer to the head) and down (closer to the tail) the queue. It also identifies elements in the queue by their id, as given by IdBean.getUniqueId(), i.e. if the queue contains an existing element with the same id as the element passed into the method as an argument, that is the element that is affected by the method called.
  • Method Details

    • getElements

      List<E> getElements()
      Return a list of contents of the queue, in the same order as they are in the queue. Note that the list is a snapshot of the contents of the queue at the time that this method is called, changes to this list will not be reflected in the underlying queue.
      Returns:
      a list of the contents of the queue
    • replace

      boolean replace(E e)
      Replaces the existing element in the queue with the same id as the given element with the given element. If the queue does not contain an element with the same id as the one given, the queue is unmodified.
      Parameters:
      e - the new element
      Returns:
      true if the queue was modified as a result of this call (i.e. the queue contained an element with the same id as the that given), false otherwise
    • moveUp

      boolean moveUp(E e)
      Moves the element in the queue with the same id as that given up the queue, i.e. towards the head. If the queue does not contain an element with the same id as the one given, the queue is unmodified.
      Parameters:
      e - the element to move up the queue
      Returns:
      true if the queue was modified as a result of this call (i.e. the queue contained an element with the same id as the that given), false otherwise
    • moveDown

      boolean moveDown(E e)
      Moves the element in the queue with the same id as that given down the queue, i.e. towards the tail. If the queue does not contain an element with the same id as the one given, the queue is unmodified.
      Parameters:
      e - the element to move down the queue
      Returns:
      true if the queue was modified as a result of this call (i.e. the queue contained an element with the same id as the that given), false otherwise