public abstract class AbstractAsyncCollection<S extends AsyncCollection<S,V>,T extends CollectionState<T,V>,U extends AsyncCollectionProxy<V>,V> extends AbstractResource<S> implements AsyncCollection<S,V>
| Modifier and Type | Field and Description |
|---|---|
protected U |
proxy |
context, executor, serializer| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAsyncCollection(ResourceContext context,
StateMachine<T> stateMachine,
Class proxyClass) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
add(V value)
Adds a entry to the collection.
|
CompletableFuture<Boolean> |
addAll(Collection<? extends V> values)
Adds a collection of entries to the collection.
|
protected <R> CompletableFuture<R> |
checkOpen(java.util.function.Supplier<CompletableFuture<R>> supplier)
If the collection is closed, returning a failed CompletableFuture.
|
CompletableFuture<Void> |
clear()
Clears all values from the collection.
|
CompletableFuture<Void> |
close() |
CompletableFuture<Boolean> |
contains(Object value)
Checks whether the collection contains a entry.
|
CompletableFuture<Boolean> |
containsAll(Collection<?> values)
Checks whether the collection contains a collection of entries.
|
CompletableFuture<Boolean> |
isEmpty()
Checks whether the collection is empty.
|
CompletableFuture<S> |
open() |
CompletableFuture<Boolean> |
remove(Object value)
Removes a entry from the collection.
|
CompletableFuture<Boolean> |
removeAll(Collection<?> values)
Removes a collection of values from the collection.
|
CompletableFuture<Boolean> |
retainAll(Collection<?> values)
Retains a collection of values in the collection.
|
CompletableFuture<Integer> |
size()
Gets the current collection size.
|
addShutdownTask, addStartupTask, cluster, isClosed, isOpen, name, runShutdownTasks, runStartupTasksclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddShutdownTask, addStartupTask, cluster, nameprotected U extends AsyncCollectionProxy<V> proxy
protected AbstractAsyncCollection(ResourceContext context, StateMachine<T> stateMachine, Class proxyClass)
protected <R> CompletableFuture<R> checkOpen(java.util.function.Supplier<CompletableFuture<R>> supplier)
R - The future result type.supplier - The supplier to call if the collection is open.public CompletableFuture<Boolean> add(V value)
AsyncCollectionProxyadd in interface AsyncCollectionProxy<V>value - The entry to add.public CompletableFuture<Boolean> addAll(Collection<? extends V> values)
AsyncCollectionProxyaddAll in interface AsyncCollectionProxy<V>values - The values to add.public CompletableFuture<Boolean> retainAll(Collection<?> values)
AsyncCollectionProxyretainAll in interface AsyncCollectionProxy<V>values - The values to retain.public CompletableFuture<Boolean> remove(Object value)
AsyncCollectionProxyremove in interface AsyncCollectionProxy<V>value - The entry to remove.public CompletableFuture<Boolean> removeAll(Collection<?> values)
AsyncCollectionProxyremoveAll in interface AsyncCollectionProxy<V>values - The collection of values to remove.public CompletableFuture<Boolean> contains(Object value)
AsyncCollectionProxycontains in interface AsyncCollectionProxy<V>value - The entry to check.public CompletableFuture<Boolean> containsAll(Collection<?> values)
AsyncCollectionProxycontainsAll in interface AsyncCollectionProxy<V>values - The collection of values to check.public CompletableFuture<Integer> size()
AsyncCollectionProxysize in interface AsyncCollectionProxy<V>public CompletableFuture<Boolean> isEmpty()
AsyncCollectionProxyisEmpty in interface AsyncCollectionProxy<V>public CompletableFuture<Void> clear()
AsyncCollectionProxyclear in interface AsyncCollectionProxy<V>public CompletableFuture<S> open()
public CompletableFuture<Void> close()
Copyright © 2013-2015. All Rights Reserved.