Interface DCircularQueue<E>

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

    public interface DCircularQueue<E>
    extends java.util.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 Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean add​(E e)
      Adds the given element to this queue.
      java.util.Iterator<E> iterator()
      boolean offer​(E e)
      Adds the given element to this queue.
      • Methods inherited from interface java.util.Collection

        addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Queue

        element, peek, poll, remove
    • Method Detail

      • 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 java.util.Collection<E>
        Specified by:
        add in interface java.util.Queue<E>
        Parameters:
        e - the element to add
        Returns:
        true, always
        Throws:
        java.lang.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 java.util.Queue<E>
        Parameters:
        e - the element to add
        Returns:
        true, always
        Throws:
        java.lang.NullPointerException - if the given element is null
      • iterator

        java.util.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 java.util.Collection<E>
        Specified by:
        iterator in interface java.lang.Iterable<E>