Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public String next() {
  2. int start = page * pageLength;
  3. int end = start + pageLength;
  4.  
  5. if (end >= text.length()) {
  6. end = text.length() - 1; // last character in the book
  7. } else {
  8. page = page + 1; // only turn the page if we are not at the end of
  9. // the book
  10. }
  11.  
  12. if (start > text.length()) {
  13. return "end";
  14. }
  15.  
  16. return text.substring(start, end);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement