(final int position)
| 247 | } |
| 248 | |
| 249 | public final void goToPosition(final int position) { |
| 250 | if (position <= 0) { |
| 251 | goToFirstPage(); |
| 252 | return; |
| 253 | } |
| 254 | |
| 255 | if (position >= chapter.getTextBuffer().length) { |
| 256 | goToLastPage(); |
| 257 | return; |
| 258 | } |
| 259 | |
| 260 | Page foundPage; |
| 261 | final int pagesSize = pages.size(); |
| 262 | for (int i = 0; i < pagesSize; i++) { |
| 263 | foundPage = (Page) pages.elementAt(i); |
| 264 | if (foundPage.contains(position)) { |
| 265 | goToPage(i); |
| 266 | return; |
| 267 | } |
| 268 | } |
| 269 | goToFirstPage(); |
| 270 | } |
| 271 | |
| 272 | public void goToPage(final int page) { |
| 273 | if (page <= 0) { |
nothing calls this directly
no test coverage detected