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 booleanfinal booleanaddAll(Collection<? extends E> c) final voidclear()final booleanfinal booleancontainsAll(Collection<?> c) final voidfinal booleanisEmpty()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 booleanfinal booleanremoveAll(Collection<?> c) final booleanfinal booleanretainAll(Collection<?> c) final intsize()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, 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
public abstract org.reactivestreams.Publisher<E> localPublisher(org.infinispan.commons.util.IntSet segments) 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
-
spliterator
- Specified by:
spliteratorin interfaceorg.infinispan.commons.util.CloseableIteratorCollection<E>- Specified by:
spliteratorin interfaceorg.infinispan.commons.util.CloseableIteratorSet<E>- Specified by:
spliteratorin interfaceCollection<E>- Specified by:
spliteratorin interfaceIterable<E>- Specified by:
spliteratorin interfaceSet<E>
-
stream
- Specified by:
streamin interfaceCacheCollection<E>- Specified by:
streamin interfaceorg.infinispan.commons.util.CloseableIteratorCollection<E>- Specified by:
streamin interfaceCollection<E>
-
parallelStream
- Specified by:
parallelStreamin interfaceCacheCollection<E>- Specified by:
parallelStreamin interfaceorg.infinispan.commons.util.CloseableIteratorCollection<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()
-