Package org.infinispan.cache.impl
Class AbstractCacheBackedSet<K,V,E>
java.lang.Object
org.infinispan.cache.impl.AbstractCacheBackedSet<K,V,E>
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
,CacheCollection<E>
,CacheSet<E>
,CloseableIteratorCollection<E>
,CloseableIteratorSet<E>
- Direct Known Subclasses:
CacheBackedEntrySet
,CacheBackedKeySet
Entry or key set backed by a cache.
- Since:
- 13.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractCacheBackedSet
(CacheImpl<K, V> cache, Object lockOwner, long explicitFlags) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adding new cache entries via a set is not allowed.boolean
addAll
(Collection<? extends E> c) Adding new cache entries via a set is not allowed.void
clear()
abstract boolean
boolean
containsAll
(Collection<?> c) protected ContextBuilder
protected abstract Object
extractKey
(Object e) Extract the key from a set element.void
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
boolean
retainAll
(Collection<?> c) int
size()
stream()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
protected abstract E
wrapElement
(E e) Wrap the element if neededMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.infinispan.CacheCollection
localPublisher, localPublisher
Methods inherited from interface java.util.Collection
toArray
-
Field Details
-
cache
-
lockOwner
-
explicitFlags
protected final long explicitFlags
-
-
Constructor Details
-
AbstractCacheBackedSet
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
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
-
forEach
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
Adding new cache entries via a set is not allowed.Please use
BasicCache.put(Object, Object)
etc. -
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
- Specified by:
containsAll
in interfaceSet<K>
-
addAll
Adding new cache entries via a set is not allowed.Please use
BasicCache.put(Object, Object)
etc. -
removeAll
-
removeIf
- Specified by:
removeIf
in interfaceCollection<K>
-
retainAll
-
clear
public void clear() -
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<K>
- Specified by:
spliterator
in interfaceCloseableIteratorSet<K>
- Specified by:
spliterator
in interfaceCollection<K>
- Specified by:
spliterator
in interfaceIterable<K>
- Specified by:
spliterator
in interfaceSet<K>
-
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<K>
- Specified by:
stream
in interfaceCloseableIteratorCollection<K>
- Specified by:
stream
in interfaceCollection<K>
-
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<K>
- Specified by:
parallelStream
in interfaceCloseableIteratorCollection<K>
- Specified by:
parallelStream
in interfaceCollection<K>
-
toString
-
decoratedWriteContextBuilder
-
entryToKeyFunction
-
extractKey
Extract the key from a set element. -
wrapElement
Wrap the element if needed
-