E - set entry typepublic class DefaultAsyncDistributedSet<E> extends Object implements AsyncDistributedSet<E>
AsyncDistributedSet.DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Constructor and Description |
|---|
DefaultAsyncDistributedSet(AsyncConsistentMap<E,Boolean> backingMap,
String name,
boolean meteringEnabled) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
add(E entry)
Adds the specified element to this set 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 set if they're not
already present (optional operation).
|
CompletableFuture<Void> |
addListener(SetEventListener<E> listener)
Registers the specified listener to be notified whenever
the set is updated.
|
CompletableFuture<Void> |
clear()
Removes all elements from the set.
|
CompletableFuture<Boolean> |
contains(E element)
Returns if this set contains the specified element.
|
CompletableFuture<Boolean> |
containsAll(Collection<? extends E> c)
Returns if this set contains all the elements in specified collection.
|
CompletableFuture<? extends Set<E>> |
getAsImmutableSet()
Returns the entries as a immutable set.
|
CompletableFuture<Boolean> |
isEmpty()
Returns if the set is empty.
|
String |
name()
Returns the name of this primitive.
|
CompletableFuture<Boolean> |
remove(E entry)
Removes the specified element to this set if it is present (optional operation).
|
CompletableFuture<Boolean> |
removeAll(Collection<? extends E> c)
Removes from this set all of its elements that are contained in the specified collection (optional operation).
|
CompletableFuture<Void> |
removeListener(SetEventListener<E> listener)
Unregisters the specified listener.
|
CompletableFuture<Boolean> |
retainAll(Collection<? extends E> c)
Retains only the elements in this set that are contained in the specified collection (optional operation).
|
CompletableFuture<Integer> |
size()
Returns the number of elements in the set.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasDistributedSet, asDistributedSet, primitiveTypeaddStatusChangeListener, applicationId, destroy, removeStatusChangeListener, statusChangeListenerspublic DefaultAsyncDistributedSet(AsyncConsistentMap<E,Boolean> backingMap, String name, boolean meteringEnabled)
public String name()
DistributedPrimitivename in interface DistributedPrimitivepublic CompletableFuture<Integer> size()
AsyncDistributedSetsize in interface AsyncDistributedSet<E>public CompletableFuture<Boolean> isEmpty()
AsyncDistributedSetisEmpty in interface AsyncDistributedSet<E>true if this set is emptypublic CompletableFuture<Boolean> contains(E element)
AsyncDistributedSetcontains in interface AsyncDistributedSet<E>element - element to checktrue if this set contains the specified elementpublic CompletableFuture<Boolean> add(E entry)
AsyncDistributedSetadd in interface AsyncDistributedSet<E>entry - element to addtrue if this set did not already contain the specified element.public CompletableFuture<Boolean> remove(E entry)
AsyncDistributedSetremove in interface AsyncDistributedSet<E>entry - element to removetrue if this set contained the specified elementpublic CompletableFuture<Boolean> containsAll(Collection<? extends E> c)
AsyncDistributedSetcontainsAll in interface AsyncDistributedSet<E>c - collectiontrue if this set contains all elements in the collectionpublic CompletableFuture<Boolean> addAll(Collection<? extends E> c)
AsyncDistributedSetaddAll in interface AsyncDistributedSet<E>c - collection containing elements to be added to this settrue if this set contains all elements in the collectionpublic CompletableFuture<Boolean> retainAll(Collection<? extends E> c)
AsyncDistributedSetretainAll in interface AsyncDistributedSet<E>c - collection containing elements to be retained in this settrue if this set changed as a result of the callpublic CompletableFuture<Boolean> removeAll(Collection<? extends E> c)
AsyncDistributedSetremoveAll in interface AsyncDistributedSet<E>c - collection containing elements to be removed from this settrue if this set changed as a result of the callpublic CompletableFuture<Void> clear()
AsyncDistributedSetclear in interface AsyncDistributedSet<E>public CompletableFuture<? extends Set<E>> getAsImmutableSet()
AsyncDistributedSetgetAsImmutableSet in interface AsyncDistributedSet<E>public CompletableFuture<Void> addListener(SetEventListener<E> listener)
AsyncDistributedSetaddListener in interface AsyncDistributedSet<E>listener - listener to notify about set update eventspublic CompletableFuture<Void> removeListener(SetEventListener<E> listener)
AsyncDistributedSetremoveListener in interface AsyncDistributedSet<E>listener - listener to unregister.