Package com.oracle.coherence.client
Class RemoteCollection<K,V,T>
- java.lang.Object
-
- com.oracle.coherence.client.RemoteCollection<K,V,T>
-
- All Implemented Interfaces:
Iterable<T>,Collection<T>
- Direct Known Subclasses:
RemoteEntrySet,RemoteKeySet,RemoteValues
public abstract class RemoteCollection<K,V,T> extends Object implements Collection<T>
A base class for implementations of collections related to a remoteAsyncNamedCacheClient, for example key set, entry set and values.This
Collectionimplementation allows removal but does not allow additions to the collection. Methodsadd(Object)addAll(Collection)will throw anUnsupportedOperationException.Some methods in this class are intentionally inefficient partly due to their being a more efficient means to perform the same task using the underlying
AsyncNamedCacheClientand partly to ensure that using this class on a client will not cause all of the data from the underlyingAsyncNamedCacheClientto be pulled back to the caller in one result.- Since:
- 20.06
- Author:
- Jonathan Knight 2019.11.12
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classRemoteCollection.EntryAdvancer<K,V>APagedIterator.Advancerto support aPagedIteratorover an entry set.protected static classRemoteCollection.EntryResultMapEntryAMap.Entryimplementation that wraps aEntryResult.
-
Field Summary
Fields Modifier and Type Field Description protected AsyncNamedCacheClient<K,V>f_clientThe wrappedAsyncNamedCacheClient.
-
Constructor Summary
Constructors Modifier Constructor Description protectedRemoteCollection(AsyncNamedCacheClient<K,V> client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(T t)booleanaddAll(Collection<? extends T> c)voidclear()booleancontainsAll(Collection<?> colKeys)protected RemoteCollection.EntryAdvancer<K,V>createEntryAdvancer()Create anRemoteCollection.EntryAdvancerto use in aPagedIterator.booleanequals(Object other)protected AsyncNamedCacheClient<K,V>getCache()Obtain the underlyingNamedCache.inthashCode()booleanisEmpty()booleanremoveAll(Collection<?> colKeys)booleanretainAll(Collection<?> colKeys)intsize()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
contains, iterator, parallelStream, remove, removeIf, spliterator, stream, toArray, toArray, toArray
-
-
-
-
Field Detail
-
f_client
protected final AsyncNamedCacheClient<K,V> f_client
The wrappedAsyncNamedCacheClient.
-
-
Constructor Detail
-
RemoteCollection
protected RemoteCollection(AsyncNamedCacheClient<K,V> client)
-
-
Method Detail
-
size
public int size()
- Specified by:
sizein interfaceCollection<K>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<K>
-
add
public boolean add(T t)
- Specified by:
addin interfaceCollection<K>
-
addAll
public boolean addAll(Collection<? extends T> c)
- Specified by:
addAllin interfaceCollection<K>
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<K>
-
containsAll
public boolean containsAll(Collection<?> colKeys)
- Specified by:
containsAllin interfaceCollection<K>
-
removeAll
public boolean removeAll(Collection<?> colKeys)
- Specified by:
removeAllin interfaceCollection<K>
-
retainAll
public boolean retainAll(Collection<?> colKeys)
- Specified by:
retainAllin interfaceCollection<K>
-
equals
public boolean equals(Object other)
- Specified by:
equalsin interfaceCollection<K>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection<K>- Overrides:
hashCodein classObject
-
getCache
protected AsyncNamedCacheClient<K,V> getCache()
Obtain the underlyingNamedCache.- Returns:
- the underlying
NamedCache
-
createEntryAdvancer
protected RemoteCollection.EntryAdvancer<K,V> createEntryAdvancer()
Create anRemoteCollection.EntryAdvancerto use in aPagedIterator.- Returns:
- an
RemoteCollection.EntryAdvancerto use in aPagedIterator
-
-