public interface AsyncDistributedCollection<E> extends AsyncPrimitive, AsyncIterable<E>
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
add(E element)
Adds the specified element to this collection if it is not already present (optional operation).
|
CompletableFuture<Boolean> |
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this collection if they're not
already present (optional operation).
|
default CompletableFuture<Void> |
addListener(CollectionEventListener<E> listener)
Registers the specified listener to be notified whenever
the collection is updated.
|
CompletableFuture<Void> |
addListener(CollectionEventListener<E> listener,
Executor executor)
Registers the specified listener to be notified whenever
the collection is updated.
|
CompletableFuture<Void> |
clear()
Removes all elements from the collection.
|
CompletableFuture<Boolean> |
contains(E element)
Returns if this collection contains the specified element.
|
CompletableFuture<Boolean> |
containsAll(Collection<? extends E> c)
Returns if this collection contains all the elements in specified collection.
|
CompletableFuture<Boolean> |
isEmpty()
Returns if the collection is empty.
|
CompletableFuture<Boolean> |
remove(E element)
Removes the specified element to this collection if it is present (optional operation).
|
CompletableFuture<Boolean> |
removeAll(Collection<? extends E> c)
Removes from this collection all of its elements that are contained in the specified collection (optional operation).
|
CompletableFuture<Void> |
removeListener(CollectionEventListener<E> listener)
Unregisters the specified listener.
|
CompletableFuture<Boolean> |
retainAll(Collection<? extends E> c)
Retains only the elements in this collection that are contained in the specified collection (optional operation).
|
CompletableFuture<Integer> |
size()
Returns the number of elements in the collection.
|
default DistributedCollection<E> |
sync()
Returns a synchronous wrapper around the asynchronous primitive.
|
DistributedCollection<E> |
sync(Duration operationTimeout)
Returns a synchronous wrapper around the asynchronous primitive.
|
close, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeiterator, streamCompletableFuture<Boolean> add(E element)
element - element to addtrue if this collection did not already contain the specified element.CompletableFuture<Boolean> remove(E element)
element - element to removetrue if this collection contained the specified elementCompletableFuture<Integer> size()
CompletableFuture<Boolean> isEmpty()
true if this collection is emptyCompletableFuture<Void> clear()
CompletableFuture<Boolean> contains(E element)
element - element to checktrue if this collection contains the specified elementCompletableFuture<Boolean> addAll(Collection<? extends E> c)
c - collection containing elements to be added to this collectiontrue if this collection contains all elements in the collectionCompletableFuture<Boolean> containsAll(Collection<? extends E> c)
c - collectiontrue if this collection contains all elements in the collectionCompletableFuture<Boolean> retainAll(Collection<? extends E> c)
c - collection containing elements to be retained in this collectiontrue if this collection changed as a result of the callCompletableFuture<Boolean> removeAll(Collection<? extends E> c)
c - collection containing elements to be removed from this collectiontrue if this collection changed as a result of the calldefault CompletableFuture<Void> addListener(CollectionEventListener<E> listener)
listener - listener to notify about collection update eventsCompletableFuture<Void> addListener(CollectionEventListener<E> listener, Executor executor)
listener - listener to notify about collection update eventsexecutor - executor on which to call event listenerCompletableFuture<Void> removeListener(CollectionEventListener<E> listener)
listener - listener to unregister.default DistributedCollection<E> sync()
AsyncPrimitivesync in interface AsyncPrimitiveDistributedCollection<E> sync(Duration operationTimeout)
AsyncPrimitivesync in interface AsyncPrimitiveoperationTimeout - the synchronous operation timeoutCopyright © 2013–2018. All rights reserved.