public class CacheSetMapper<E,R> extends SetMapper<E,R> implements CacheSet<R>
CacheSet
that allows for a different set to be mapped as a different instance wtih values replaced on
request. This is useful as a cache set is normally lazily evaluated to prevent having to pull all values into memory
which can be a lot faster when checking single values and can also prevent out of memory issues.Modifier and Type | Field and Description |
---|---|
protected CacheSet<E> |
realSet |
mapper, realCollection
Constructor and Description |
---|
CacheSetMapper(CacheSet<E> realSet,
Function<? super E,? extends R> mapper) |
Modifier and Type | Method and Description |
---|---|
CloseableIterator<R> |
iterator() |
CacheStream<R> |
parallelStream() |
CloseableSpliterator<R> |
spliterator() |
CacheStream<R> |
stream() |
add, addAll, clear, forEach, isEmpty, remove, removeAll, retainAll, size
contains, containsAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
localPublisher, localPublisher
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
removeIf
public CacheStream<R> stream()
CloseableIteratorCollection
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
stream
in interface Collection<R>
stream
in interface CacheCollection<R>
stream
in interface CloseableIteratorCollection<R>
stream
in class CollectionMapper<E,R>
public CacheStream<R> parallelStream()
CloseableIteratorCollection
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
parallelStream
in interface Collection<R>
parallelStream
in interface CacheCollection<R>
parallelStream
in interface CloseableIteratorCollection<R>
parallelStream
in class CollectionMapper<E,R>
public CloseableSpliterator<R> spliterator()
CloseableIteratorCollection
This spliterator should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
spliterator
in interface Iterable<R>
spliterator
in interface Collection<R>
spliterator
in interface Set<R>
spliterator
in interface CloseableIteratorCollection<R>
spliterator
in interface CloseableIteratorSet<R>
spliterator
in class CollectionMapper<E,R>
public CloseableIterator<R> iterator()
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
Copyright © 2021 JBoss by Red Hat. All rights reserved.