public class CollectionMapper<E,R> extends AbstractCollection<R>
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.
Modifier and Type | Field and Description |
---|---|
protected Function<? super E,? extends R> |
mapper |
protected Collection<E> |
realCollection |
Constructor and Description |
---|
CollectionMapper(Collection<E> realCollection,
Function<? super E,? extends R> mapper) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(R e) |
boolean |
addAll(Collection<? extends R> c) |
void |
clear() |
void |
forEach(Consumer<? super R> action) |
boolean |
isEmpty() |
Iterator<R> |
iterator() |
Stream<R> |
parallelStream() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Spliterator<R> |
spliterator() |
Stream<R> |
stream() |
contains, containsAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, removeIf
protected final Collection<E> realCollection
public CollectionMapper(Collection<E> realCollection, Function<? super E,? extends R> mapper)
public int size()
size
in interface Collection<R>
size
in class AbstractCollection<R>
public boolean isEmpty()
isEmpty
in interface Collection<R>
isEmpty
in class AbstractCollection<R>
public Iterator<R> iterator()
iterator
in interface Iterable<R>
iterator
in interface Collection<R>
iterator
in class AbstractCollection<R>
public Spliterator<R> spliterator()
public boolean add(R e)
add
in interface Collection<R>
add
in class AbstractCollection<R>
public boolean remove(Object o)
remove
in interface Collection<R>
remove
in class AbstractCollection<R>
public boolean addAll(Collection<? extends R> c)
addAll
in interface Collection<R>
addAll
in class AbstractCollection<R>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<R>
removeAll
in class AbstractCollection<R>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<R>
retainAll
in class AbstractCollection<R>
public void clear()
clear
in interface Collection<R>
clear
in class AbstractCollection<R>
Copyright © 2021 JBoss by Red Hat. All rights reserved.