Class CouchbaseQueue<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
com.couchbase.client.java.datastructures.CouchbaseQueue<E>
- Type Parameters:
E
- the type of values in the queue.
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Queue<E>
A CouchbaseQueue is a
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.- Since:
- 2.3.6
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCouchbaseQueue
(String id, Collection collection, Class<E> entityType, QueueOptions options) -
Method Summary
Methods inherited from class java.util.AbstractQueue
add, addAll, element, remove
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray
-
Constructor Details
-
CouchbaseQueue
Create a newCouchbase-backed
Queue, backed by the document identified byid
inbucket
. Note that if the document already exists, its content will be used as initial content for this collection. Otherwise it is created empty.- Parameters:
id
- the id of the Couchbase document to back the queue.collection
- theCollection
through which to interact with the document.entityType
- aClass
describing the type of objects in this Set.options
- aCommonDatastructureOptions
to use for all operations on this instance of the queue.
-
-
Method Details
-
iterator
- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in classAbstractCollection<E>
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Overrides:
clear
in classAbstractQueue<E>
-
offer
-
poll
-
peek
-