Package org.aksw.commons.rx.cache.range
Class ListPaginatorWithSimpleCache<T>
java.lang.Object
org.aksw.commons.util.delegate.AbstractDelegated<RangedSupplier<I,P>>
org.aksw.commons.rx.range.RangedSupplierDelegated<Long,T>
org.aksw.commons.rx.cache.range.ListPaginatorWithSimpleCache<T>
- All Implemented Interfaces:
Function<com.google.common.collect.Range<Long>,,io.reactivex.rxjava3.core.Flowable<T>> ListPaginator<T>,RangedSupplier<Long,,T> Delegated<RangedSupplier<Long,,T>> Unwrappable
public class ListPaginatorWithSimpleCache<T>
extends RangedSupplierDelegated<Long,T>
implements ListPaginator<T>
A cache that upon any item or count request caches the full range of data
into a (java) List and subsequently serves the request from the cache.
This class performs only at most a single request to the delegate's apply method.
- Author:
- raven
-
Field Summary
FieldsFields inherited from class org.aksw.commons.util.delegate.AbstractDelegated
delegate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Flowable<T>io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>>fetchCount(Long itemLimit, Long rowLimit) static <V> ListPaginator<V>wrap(ListPaginator<V> backend) Methods inherited from class org.aksw.commons.util.delegate.AbstractDelegated
delegate, equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aksw.commons.rx.lookup.ListPaginator
batch, fetchList, mapMethods inherited from interface org.aksw.commons.util.delegate.Unwrappable
unwrap
-
Field Details
-
cache
-
-
Constructor Details
-
ListPaginatorWithSimpleCache
-
-
Method Details
-
fetchCount
public io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>> fetchCount(Long itemLimit, Long rowLimit) - Specified by:
fetchCountin interfaceListPaginator<T>- Parameters:
itemLimit- This argument is ignoredrowLimit- This argument is Ignored
-
apply
-
wrap
-