Package org.infinispan.commands.read
Class AbstractCloseableIteratorCollection<O,K,V>
- java.lang.Object
-
- java.util.AbstractCollection<O>
-
- org.infinispan.commands.read.AbstractCloseableIteratorCollection<O,K,V>
-
- All Implemented Interfaces:
Iterable<O>
,Collection<O>
,org.infinispan.commons.util.CloseableIteratorCollection<O>
- Direct Known Subclasses:
DistributionBulkInterceptor.BackingEntrySet
,DistributionBulkInterceptor.BackingKeySet
,ValueCacheCollection
public abstract class AbstractCloseableIteratorCollection<O,K,V> extends AbstractCollection<O> implements org.infinispan.commons.util.CloseableIteratorCollection<O>
Abstract collection that uses an underlying Cache instance to do various operations. This is useful for a backing collection such as entrySet, keySet or values from the Map interface. Implementors only need to implement individual methods such asCollection.contains(Object)
,Collection.remove(Object)
andCloseableIteratorCollection.iterator()
. TheCollection.add(Object)
by default will throw anUnsupportedOperationException
.- Since:
- 7.0
- Author:
- wburns
-
-
Constructor Summary
Constructors Constructor Description AbstractCloseableIteratorCollection(Cache<K,V> cache)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
abstract boolean
contains(Object o)
boolean
isEmpty()
abstract org.infinispan.commons.util.CloseableIterator<O>
iterator()
abstract boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
abstract org.infinispan.commons.util.CloseableSpliterator<O>
spliterator()
Object[]
toArray()
<T> T[]
toArray(T[] a)
-
Methods inherited from class java.util.AbstractCollection
add, addAll, containsAll, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commons.util.CloseableIteratorCollection
parallelStream, stream
-
Methods inherited from interface java.util.Collection
add, addAll, containsAll, equals, hashCode, removeIf, toArray
-
-
-
-
Method Detail
-
iterator
public abstract org.infinispan.commons.util.CloseableIterator<O> iterator()
- Specified by:
iterator
in interfaceorg.infinispan.commons.util.CloseableIteratorCollection<O>
- Specified by:
iterator
in interfaceCollection<O>
- Specified by:
iterator
in interfaceIterable<O>
- Specified by:
iterator
in classAbstractCollection<O>
-
spliterator
public abstract org.infinispan.commons.util.CloseableSpliterator<O> spliterator()
- Specified by:
spliterator
in interfaceorg.infinispan.commons.util.CloseableIteratorCollection<O>
- Specified by:
spliterator
in interfaceCollection<O>
- Specified by:
spliterator
in interfaceIterable<O>
-
contains
public abstract boolean contains(Object o)
- Specified by:
contains
in interfaceCollection<O>
- Overrides:
contains
in classAbstractCollection<O>
-
remove
public abstract boolean remove(Object o)
- Specified by:
remove
in interfaceCollection<O>
- Overrides:
remove
in classAbstractCollection<O>
-
size
public int size()
- Specified by:
size
in interfaceCollection<O>
- Specified by:
size
in classAbstractCollection<O>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection<O>
- Overrides:
isEmpty
in classAbstractCollection<O>
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection<O>
- Overrides:
toArray
in classAbstractCollection<O>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArray
in interfaceCollection<O>
- Overrides:
toArray
in classAbstractCollection<O>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAll
in interfaceCollection<O>
- Overrides:
removeAll
in classAbstractCollection<O>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAll
in interfaceCollection<O>
- Overrides:
retainAll
in classAbstractCollection<O>
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<O>
- Overrides:
clear
in classAbstractCollection<O>
-
-