Class CouchbaseArrayList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
com.couchbase.client.java.datastructures.CouchbaseArrayList<E>
- Type Parameters:
E- the type of values in the list.
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>
A CouchbaseArrayList is a
List backed by a Couchbase document (more
specifically a JSON array).
Note that as such, a CouchbaseArrayList is restricted to the types that a JSON array
can contain. JSON objects and sub-arrays can be represented as JsonObject and JsonArray
respectively.- Since:
- 2.3.6
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionCouchbaseArrayList(String id, Collection collection, Class<E> entityType, ArrayListOptions options) -
Method Summary
Methods inherited from class java.util.AbstractList
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.util.List
addAll, containsAll, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
CouchbaseArrayList
public CouchbaseArrayList(String id, Collection collection, Class<E> entityType, ArrayListOptions options) Create a newCouchbase-backedList, backed by the document identified byidincollection. 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 list.collection- theCollectionthrough which to interact with the document.entityType- a Class describing the type of objects in this Set.options- aArrayListOptionsto use for all operations on this instance of the list.
-
-
Method Details
-
get
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceList<E>- Specified by:
sizein classAbstractCollection<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceList<E>- Overrides:
isEmptyin classAbstractCollection<E>
-
set
-
add
-
remove
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceList<E>- Overrides:
containsin classAbstractCollection<E>
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classAbstractList<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractList<E>
-