org.ektorp
Class Page<T>

java.lang.Object
  extended by org.ektorp.Page<T>
All Implemented Interfaces:
Iterable<T>

public class Page<T>
extends Object
implements Iterable<T>


Constructor Summary
Page(List<T> rows, int totalSize, int pageSize, PageRequest previousPageRequest, PageRequest nextPageRequest)
           
 
Method Summary
 String getNextLink()
           
 PageRequest getNextPageRequest()
           
 int getPageSize()
           
 String getPreviousLink()
           
 PageRequest getPreviousPageRequest()
           
 List<T> getRows()
          Exists mainly for providing compatibility with the c:forEach in jstl (1.2) as it cannot handle java.lang.Iterable
 int getTotalSize()
           
 boolean isHasNext()
          Has a silly name in order to conform with the java beans naming convention
 boolean isHasPrevious()
          Has a silly name in order to conform with the java beans naming convention
 Iterator<T> iterator()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Page

public Page(List<T> rows,
            int totalSize,
            int pageSize,
            PageRequest previousPageRequest,
            PageRequest nextPageRequest)
Method Detail

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>

getRows

public List<T> getRows()
Exists mainly for providing compatibility with the c:forEach in jstl (1.2) as it cannot handle java.lang.Iterable

Returns:

isHasNext

public boolean isHasNext()
Has a silly name in order to conform with the java beans naming convention

Returns:
true if there is a next page

isHasPrevious

public boolean isHasPrevious()
Has a silly name in order to conform with the java beans naming convention

Returns:
true if there is a previous page

getTotalSize

public int getTotalSize()
Returns:
the total number of items across all pages

getPageSize

public int getPageSize()
Returns:
the maximum number of items this page may contain.

getNextLink

public String getNextLink()
Returns:
the next page request encoded in a URL-save string.
Throws:
IllegalStateException - of no next page exists
See Also:
PageRequest

getNextPageRequest

public PageRequest getNextPageRequest()

getPreviousPageRequest

public PageRequest getPreviousPageRequest()

getPreviousLink

public String getPreviousLink()
Returns:
the previous page request encoded in a URL-save string.
Throws:
IllegalStateException - of no previous page exists
See Also:
PageRequest

size

public int size()


Copyright © 2011. All Rights Reserved.