E
- the type of values in the queue.@Stability.Committed public class CouchbaseQueue<E> extends AbstractQueue<E>
Queue
backed by a Couchbase
document (more
specifically a JSON array
).
Note that as such, a CouchbaseQueue is restricted to the types that a JSON array
can contain. JSON objects and sub-arrays can be represented as JsonObject
and JsonArray
respectively. Null values are not allowed as they have special meaning for the peek()
and AbstractQueue.remove()
methods of a queue.Modifier and Type | Class and Description |
---|---|
class |
CouchbaseQueue.CouchbaseQueueIterator<E> |
Constructor and Description |
---|
CouchbaseQueue(String id,
Collection collection,
Class<E> entityType,
QueueOptions options)
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Iterator<E> |
iterator() |
boolean |
offer(E e) |
E |
peek() |
E |
poll() |
int |
size() |
add, addAll, element, remove
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
public CouchbaseQueue(String id, Collection collection, Class<E> entityType, QueueOptions options)
Couchbase-backed
Queue, backed by the document identified by id
in bucket
. Note that if the document already exists, its content will be used as initial
content for this collection. Otherwise it is created empty.id
- the id of the Couchbase document to back the queue.collection
- the Collection
through which to interact with the document.entityType
- a Class
describing the type of objects in this Set.options
- a CommonDatastructureOptions
to use for all operations on this instance of the queue.public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in class AbstractCollection<E>
public int size()
size
in interface Collection<E>
size
in class AbstractCollection<E>
public void clear()
clear
in interface Collection<E>
clear
in class AbstractQueue<E>
public boolean offer(E e)
public E poll()
public E peek()
Copyright © 2024 Couchbase, Inc.. All rights reserved.