|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.ofbiz.PagedDatabaseIterable<E,K>
public abstract class PagedDatabaseIterable<E,K>
A abstract implementation of EnclosedIterable
that takes a list of ids and
then pages them by opening an OfBizListIterator
for each page.
DatabaseIterator
but implements paging and sorting on top of it.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.jira.util.collect.EnclosedIterable |
---|
EnclosedIterable.Functions, EnclosedIterable.ListResolver<T> |
Constructor Summary | |
---|---|
PagedDatabaseIterable(List<K> ids)
Use where the order of the result is not important. |
|
PagedDatabaseIterable(List<K> ids,
Resolver<E,K> keyResolver)
Use where the order of the result is important. |
|
PagedDatabaseIterable(List<K> ids,
Resolver<E,K> keyResolver,
int pageSize)
Use where the order of the result is important. |
Method Summary | |
---|---|
protected abstract OfBizListIterator |
createListIterator(List<K> ids)
Create a new iterator from the subset of ids. |
void |
foreach(Consumer<E> consumer)
Apply the sink to all elements in the Collection. |
protected abstract Resolver<org.ofbiz.core.entity.GenericValue,E> |
getResolver()
Used to turn generic values into Domain objects |
boolean |
isEmpty()
|
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PagedDatabaseIterable(List<K> ids)
ids
- a Listpublic PagedDatabaseIterable(List<K> ids, Resolver<E,K> keyResolver)
ids
- a ListkeyResolver
- to get a domain object's key (ie. the element in the ids list). Null if sort order is
unimportantpublic PagedDatabaseIterable(List<K> ids, Resolver<E,K> keyResolver, int pageSize)
ids
- a ListkeyResolver
- to get a domain object's key (ie. the element in the ids list). Null if sort order is
unimportantpageSize
- the size of the pages to useMethod Detail |
---|
public final void foreach(Consumer<E> consumer)
EnclosedIterable
foreach
in interface EnclosedIterable<E>
protected abstract OfBizListIterator createListIterator(List<K> ids)
ids
- list of ids
protected abstract Resolver<org.ofbiz.core.entity.GenericValue,E> getResolver()
public final int size()
size
in interface EnclosedIterable<E>
size
in interface Sized
EnclosedIterable.foreach(Consumer)
. Be careful depending on this size
being exact, as in many cases its best efforts value or may be stable due to concurrent changes.public boolean isEmpty()
isEmpty
in interface EnclosedIterable<E>
isEmpty
in interface Sized
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |