Tanzu GemFire Distributed Types Java API Reference
Package dev.gemfire.dtype
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 aQueuethat 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 JavaSerializableor one of GemFire's serializable types such asDataSerializable.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 booleanadd(E e)Adds the given element to this queue.java.util.Iterator<E>iterator()booleanoffer(E e)Adds the given element to this queue.
-
-
-
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.
-
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:
offerin interfacejava.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.
removeoperations are NOT supported for iteration over this structure and will throw anUnsupportedOperationException.
-
-