Interface DCircularQueue<E>

Type Parameters:
E - the type of elements in this queue
All Superinterfaces:
Collection<E>, DType, Iterable<E>, Queue<E>

public interface DCircularQueue<E> extends Queue<E>, DType
An implementation of a Queue that provides a first-in first-out queue with a fixed size that replaces its oldest element if full. Most operations are forwarded to the backend cluster where the actual data is maintained. Objects added to a queue need to be serializable either as Java Serializable or one of GemFire's serializable types such as DataSerializable.

Note that iteration methods will serialize the whole structure to the client and perform the iteration locally. Iterators do not support remove() and will throw an UnsupportedOperationException.

Implementation_Note
The backing queue does not allow null elements to be added.
  • Method Details

    • add

      boolean add(E e)
      Adds the given element to this queue. If the queue is full, the least recently added element is discarded so that a new element can be inserted.
      Specified by:
      add in interface Collection<E>
      Specified by:
      add in interface Queue<E>
      Parameters:
      e - the element to add
      Returns:
      true, always
      Throws:
      NullPointerException - if the given element is null
    • offer

      boolean offer(E e)
      Adds the given element to this queue. If the queue is full, the least recently added element is discarded so that a new element can be inserted.
      Specified by:
      offer in interface Queue<E>
      Parameters:
      e - the element to add
      Returns:
      true, always
      Throws:
      NullPointerException - if the given element is null
    • iterator

      Iterator<E> iterator()

      Note that iteration occurs on the client. As such, the entire structure will be serialized to the client and then discarded once iteration is complete.

      remove operations are NOT supported for iteration over this structure and will throw an UnsupportedOperationException.

      Specified by:
      iterator in interface Collection<E>
      Specified by:
      iterator in interface Iterable<E>