Package org.infinispan
Class InternalCacheSet<E>
java.lang.Object
org.infinispan.InternalCacheSet<E>
- Type Parameters:
E
- The element type
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
,CacheCollection<E>
,CacheSet<E>
,org.infinispan.commons.util.CloseableIteratorCollection<E>
,org.infinispan.commons.util.CloseableIteratorSet<E>
Base class for internal classes used in cache collections.
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 boolean
final boolean
addAll
(Collection<? extends E> c) final void
clear()
final boolean
final boolean
containsAll
(Collection<?> c) final void
final boolean
isEmpty()
final org.infinispan.commons.util.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
(org.infinispan.commons.util.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 org.infinispan.commons.util.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
public abstract org.reactivestreams.Publisher<E> localPublisher(org.infinispan.commons.util.IntSet segments) 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
-
spliterator
- Specified by:
spliterator
in interfaceorg.infinispan.commons.util.CloseableIteratorCollection<E>
- Specified by:
spliterator
in interfaceorg.infinispan.commons.util.CloseableIteratorSet<E>
- Specified by:
spliterator
in interfaceCollection<E>
- Specified by:
spliterator
in interfaceIterable<E>
- Specified by:
spliterator
in interfaceSet<E>
-
stream
- Specified by:
stream
in interfaceCacheCollection<E>
- Specified by:
stream
in interfaceorg.infinispan.commons.util.CloseableIteratorCollection<E>
- Specified by:
stream
in interfaceCollection<E>
-
parallelStream
- Specified by:
parallelStream
in interfaceCacheCollection<E>
- Specified by:
parallelStream
in interfaceorg.infinispan.commons.util.CloseableIteratorCollection<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()
-