|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.ofbiz.PagedDatabaseIterable
public abstract class PagedDatabaseIterable
A abstract implementation of CloseableIterable
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.CloseableIterable |
---|
CloseableIterable.ListResolver |
Constructor Summary | |
---|---|
PagedDatabaseIterable(List ids)
Use where the order of the result is not important. |
|
PagedDatabaseIterable(List ids,
Resolver keyResolver)
Use where the order of the result is important. |
|
PagedDatabaseIterable(List ids,
Resolver keyResolver,
int pageSize)
Use where the order of the result is important. |
Method Summary | |
---|---|
protected abstract OfBizListIterator |
createListIterator(List ids)
Create a new iterator from the subset of ids. |
protected abstract Resolver |
getResolver()
Used to turn generic values into Domain objects |
boolean |
isEmpty()
|
CloseableIterator |
iterator()
|
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 ids)
ids
- a Listpublic PagedDatabaseIterable(List ids, Resolver 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 ids, Resolver 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 CloseableIterator iterator()
iterator
in interface CloseableIterable
CloseableIterator
that can be closed once finished withprotected abstract OfBizListIterator createListIterator(List ids)
ids
- list of ids
protected abstract Resolver getResolver()
public final int size()
size
in interface CloseableIterable
size
in interface Sized
CloseableIterable.iterator()
. 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 CloseableIterable
CloseableIterable.iterator()
.hasNext() will return false;
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |