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
-
Constructor Summary
ConstructorDescriptionCollectionMapper
(Collection<E> realCollection, Function<? super E, ? extends R> mapper) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends R> c) void
clear()
void
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
stream()
Methods inherited from class java.util.AbstractCollection
contains, containsAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
size
in interfaceCollection<E>
- Specified by:
size
in classAbstractCollection<R>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<E>
- Overrides:
isEmpty
in classAbstractCollection<R>
-
iterator
- Specified by:
iterator
in interfaceCollection<E>
- Specified by:
iterator
in interfaceIterable<E>
- Specified by:
iterator
in classAbstractCollection<R>
-
spliterator
-
stream
-
parallelStream
-
forEach
-
add
- Specified by:
add
in interfaceCollection<E>
- Overrides:
add
in classAbstractCollection<R>
-
remove
- Specified by:
remove
in interfaceCollection<E>
- Overrides:
remove
in classAbstractCollection<R>
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
- Overrides:
addAll
in classAbstractCollection<R>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Overrides:
removeAll
in classAbstractCollection<R>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Overrides:
retainAll
in classAbstractCollection<R>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Overrides:
clear
in classAbstractCollection<R>
-