public abstract class AbstractPageableIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>, java.lang.Iterable<T>, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractPageableIterator.NextDecorator<T>
The Class NextDecorator.
|
static class |
AbstractPageableIterator.Pager<T>
The Class Pager.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractPageableIterator()
Instantiates a new abstract pageable iterator.
|
|
AbstractPageableIterator(int pageSize)
Instantiates a new abstract pageable iterator.
|
Modifier and Type | Method and Description |
---|---|
protected T |
decorateNext(T item)
Decorate next.
|
protected java.util.List<? extends T> |
doExecutePage()
Do execute page.
|
protected abstract java.util.List<? extends T> |
doPage(int currentPosition,
int pageSize)
Returns a page of results.
|
protected int |
getGlobalPosition()
Gets the global position.
|
protected int |
getPageSize()
Gets the page size.
|
boolean |
hasNext() |
protected boolean |
isDecorateNext()
Checks if is decorate next.
|
protected boolean |
isPageNeeded()
Checks if is page needed.
|
java.util.Iterator<T> |
iterator() |
T |
next() |
protected void |
page()
Page.
|
protected void |
pageIfNecessary()
Page if necessary.
|
void |
remove() |
protected void |
setDecorateNext(boolean decorateNext)
Sets the decorate next.
|
protected AbstractPageableIterator()
public AbstractPageableIterator(int pageSize)
pageSize
- the page sizepublic java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public boolean hasNext()
hasNext
in interface java.util.Iterator<T>
protected void pageIfNecessary()
public void remove()
remove
in interface java.util.Iterator<T>
protected boolean isPageNeeded()
protected final void page()
protected java.util.List<? extends T> doExecutePage()
protected abstract java.util.List<? extends T> doPage(int currentPosition, int pageSize)
currentPosition
- the current positionpageSize
- the page sizeprotected T decorateNext(T item)
item
- the itemprotected void setDecorateNext(boolean decorateNext)
decorateNext
- the new decorate nextprotected boolean isDecorateNext()
protected int getPageSize()
protected int getGlobalPosition()