Skip to content

Instantly share code, notes, and snippets.

@alexzhan
Created October 8, 2010 08:53
Show Gist options
  • Save alexzhan/616529 to your computer and use it in GitHub Desktop.
Save alexzhan/616529 to your computer and use it in GitHub Desktop.
//setter and getter of pagination and currentPage is ignored
private List<Integer> pagination = new ArrayList<Integer>();
int up = (currentPage / 20 + 1) * 20 + currentPage % 20 + 1 -10;
int down = (currentPage / 20) * 20 + currentPage % 20 - 10;
for( int i = down; i < up; i ++){
if(i >= 1)
pagination.add(i);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment