E - Type of enumerated elements.final class CachedElementWrapper<E> extends Object
CachedEnumerable caches the enumerated elements in linked lists
made of CachedElementWrapper instances and iterated upon
by CacheEnumerator instances.
| Constructor and Description |
|---|
CachedElementWrapper(E elem,
Supplier<Nullable<E>> nextSupplier,
long limit,
long ordinal,
Runnable disableProc)
Constructs a
CachedElementWrapper instance that wraps the given
element while allowing the generation of the next element up to the
given limit. |
| Modifier and Type | Method and Description |
|---|---|
E |
getElement()
Gets the wrapped element.
|
Optional<CachedElementWrapper<E>> |
getNextWrapper()
Gets the wrapper of the next element in the cached list, if any.
|
public CachedElementWrapper(E elem, Supplier<Nullable<E>> nextSupplier, long limit, long ordinal, Runnable disableProc)
CachedElementWrapper instance that wraps the given
element while allowing the generation of the next element up to the
given limit.elem - wrapped element.nextSupplier - supplier of the next element in the cached list.limit - maximum number of elements in the cached list.ordinal - position of the current element in the cached list. The
first element in the list has an ordinal of 1.disableProc - procedure to call when the cached list reaches limit.CachedElementWrapper,
CachedEnumerable,
CacheEnumeratorpublic E getElement()
public Optional<CachedElementWrapper<E>> getNextWrapper()
Optional wrapper for the next element.Copyright © 2016. All rights reserved.