Class InternalCacheSet<E>
- Type Parameters:
E- The element type
- All Implemented Interfaces:
Iterable<E>,Collection<E>,Set<E>,CacheCollection<E>,CacheSet<E>,CloseableIteratorCollection<E>,CloseableIteratorSet<E>
It extends CacheSet because that's what interceptors used return for
KeySetCommand and EntrySetCommand,
but because these classes are only used internally, we can avoid implementing most of the methods.
Subclasses only need to implement localPublisher(IntSet) and localPublisher(int),
and a facade class like CacheBackedKeySet implements the rest of the
CacheSet methods.
- Since:
- 14.0
- Author:
- Dan Berindei
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanfinal booleanaddAll(Collection<? extends E> c) final voidclear()final booleanfinal booleancontainsAll(Collection<?> c) final voidfinal booleanisEmpty()final CloseableIterator<E>iterator()abstract org.reactivestreams.Publisher<E>localPublisher(int segment) Returns a publisher that will publish all elements that map to the given segment.abstract org.reactivestreams.Publisher<E>localPublisher(IntSet segments) Returns a publisher that will publish all elements that map to the given segment.final CacheStream<E>final booleanfinal booleanremoveAll(Collection<?> c) final booleanfinal booleanretainAll(Collection<?> c) final intsize()final CloseableSpliterator<E>final CacheStream<E>stream()final Object[]toArray()final <T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
toArray
-
Constructor Details
-
InternalCacheSet
public InternalCacheSet()
-
-
Method Details
-
localPublisher
Description copied from interface:CacheCollectionReturns a publisher that will publish all elements that map to the given segment. Note this publisher may require going remotely to retrieve elements depending on the underlying configuration and flags applied to the original Cache used to create this CacheCollection.- Specified by:
localPublisherin interfaceCacheCollection<E>- Parameters:
segment- the segment that all published elements belong to- Returns:
- Publisher that will publish the elements for the given segment
-
localPublisher
Description copied from interface:CacheCollectionReturns a publisher that will publish all elements that map to the given segment. Note this publisher may require going remotely to retrieve elements depending on the underlying configuration and flags applied to the original Cache used to create this CacheCollection.- Specified by:
localPublisherin interfaceCacheCollection<E>- Parameters:
segments- the segments that all published elements belong to- Returns:
- Publisher that will publish the elements for the given segments
-
removeIf
- Specified by:
removeIfin interfaceCollection<E>
-
forEach
-
iterator
Description copied from interface:CloseableIteratorCollectionThis iterator should be explicitly closed when iteration upon it is completed. Failure to do so could cause resources to not be freed properly
-
spliterator
Description copied from interface:CloseableIteratorCollectionThis spliterator should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
spliteratorin interfaceCloseableIteratorCollection<E>- Specified by:
spliteratorin interfaceCloseableIteratorSet<E>- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>- Specified by:
spliteratorin interfaceSet<E>
-
stream
Description copied from interface:CloseableIteratorCollectionThis stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
streamin interfaceCacheCollection<E>- Specified by:
streamin interfaceCloseableIteratorCollection<E>- Specified by:
streamin interfaceCollection<E>
-
parallelStream
Description copied from interface:CloseableIteratorCollectionThis stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
parallelStreamin interfaceCacheCollection<E>- Specified by:
parallelStreamin interfaceCloseableIteratorCollection<E>- Specified by:
parallelStreamin interfaceCollection<E>
-
size
public final int size() -
isEmpty
public final boolean isEmpty() -
contains
-
toArray
-
toArray
public final <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
addAll
-
removeAll
-
retainAll
-
clear
public final void clear()
-