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
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
final boolean
addAll
(Collection<? extends E> c) final void
clear()
final boolean
final boolean
containsAll
(Collection<?> c) final void
final boolean
isEmpty()
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 boolean
final boolean
removeAll
(Collection<?> c) final boolean
final boolean
retainAll
(Collection<?> c) final int
size()
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, wait
Methods inherited from interface java.util.Collection
toArray
-
Constructor Details
-
InternalCacheSet
public InternalCacheSet()
-
-
Method Details
-
localPublisher
Description copied from interface:CacheCollection
Returns 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:
localPublisher
in 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:CacheCollection
Returns 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:
localPublisher
in 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:
removeIf
in interfaceCollection<E>
-
forEach
-
iterator
Description copied from interface:CloseableIteratorCollection
This 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:CloseableIteratorCollection
This spliterator should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
spliterator
in interfaceCloseableIteratorCollection<E>
- Specified by:
spliterator
in interfaceCloseableIteratorSet<E>
- Specified by:
spliterator
in interfaceCollection<E>
- Specified by:
spliterator
in interfaceIterable<E>
- Specified by:
spliterator
in interfaceSet<E>
-
stream
Description copied from interface:CloseableIteratorCollection
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
stream
in interfaceCacheCollection<E>
- Specified by:
stream
in interfaceCloseableIteratorCollection<E>
- Specified by:
stream
in interfaceCollection<E>
-
parallelStream
Description copied from interface:CloseableIteratorCollection
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
parallelStream
in interfaceCacheCollection<E>
- Specified by:
parallelStream
in interfaceCloseableIteratorCollection<E>
- Specified by:
parallelStream
in 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:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
addAll
-
removeAll
-
retainAll
-
clear
public final void clear()
-