MCPcopy Create free account
hub / github.com/dumbledore/AlbiteREADER / goToPosition

Method goToPosition

src/org/albite/book/view/Booklet.java:249–270  ·  view source on GitHub ↗
(final int position)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 6

goToFirstPageMethod · 0.95
goToLastPageMethod · 0.95
containsMethod · 0.95
goToPageMethod · 0.95
getTextBufferMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected