public boolean nextPage(){
  if (toIndex >= values) {
    return false;
  }
  if (toIndex > 0) {
    fromIndex+=pageSize;
  }
  toIndex=Math.min((fromIndex + pageSize),values);
  return true;
}

public boolean nextPage ( ) { if ( toIndex >= values ) { return false ; } if ( toIndex > 0 ) { fromIndex += pageSize ; } toIndex = Math . min ( ( fromIndex + pageSize ) , values ) ; return true ; }
moves the range to the next page . returns true if the range has another page , false if not .
