Package org.infinispan.util
Class CollectionMapper<E,R>
java.lang.Object
java.util.AbstractCollection<R>
org.infinispan.util.CollectionMapper<E,R>
- All Implemented Interfaces:
Iterable<R>,Collection<R>
- Direct Known Subclasses:
SetMapper,WriteableCacheCollectionMapper
A collection that maps another one to a new one of a possibly different type. Note this collection is read only
and doesn't accept write operations.
Some operations such as Collection.contains(Object) and Collection.containsAll(Collection) may be
more expensive then normal since they cannot utilize lookups into the original collection.
- Since:
- 9.0
- Author:
- wburns
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectionMapper(Collection<E> realCollection, Function<? super E, ? extends R> mapper) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends R> c) voidclear()voidbooleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()stream()Methods inherited from class java.util.AbstractCollection
contains, containsAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, removeIf, toArray
-
Field Details
-
realCollection
-
mapper
-
-
Constructor Details
-
CollectionMapper
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein classAbstractCollection<R>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Overrides:
isEmptyin classAbstractCollection<R>
-
iterator
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin classAbstractCollection<R>
-
spliterator
-
stream
-
parallelStream
-
forEach
-
add
- Specified by:
addin interfaceCollection<E>- Overrides:
addin classAbstractCollection<R>
-
remove
- Specified by:
removein interfaceCollection<E>- Overrides:
removein classAbstractCollection<R>
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Overrides:
addAllin classAbstractCollection<R>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Overrides:
removeAllin classAbstractCollection<R>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Overrides:
retainAllin classAbstractCollection<R>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Overrides:
clearin classAbstractCollection<R>
-