@Override public boolean hasNext() { if (!initialized) { min(root, from); initialized = true; fetchNext(); } return current != null; }
/** * Skip over that many entries. This method is relatively fast (for this map * implementation) even if many entries need to be skipped. * * @param n the number of entries to skip */ public void skip(long n) { if (!hasNext()) { return; } if (n < 10) { while (n-- > 0) { fetchNext(); } return; } long index = map.getKeyIndex(current); K k = map.getKey(index + n); pos = null; min(root, k); fetchNext(); }
/** * Fetch the next entry if there is one. */ @SuppressWarnings("unchecked") private void fetchNext() { while (pos != null) { if (pos.index < pos.page.getKeyCount()) { int index = pos.index++; current = (K) pos.page.getKey(index); currentValue = (V) pos.page.getValue(index); return; } pos = pos.parent; if (pos == null) { break; } if (pos.index < map.getChildPageCount(pos.page)) { min(pos.page.getChildPage(pos.index++), null); } } current = null; }
@Override public boolean hasNext() { if (!initialized) { min(root, from); initialized = true; fetchNext(); } return current != null; }
@Override public boolean hasNext() { if (!initialized) { min(root, from); initialized = true; fetchNext(); } return current != null; }
@Override public boolean hasNext() { if (!initialized) { min(root, from); initialized = true; fetchNext(); } return current != null; }
/** * Skip over that many entries. This method is relatively fast (for this map * implementation) even if many entries need to be skipped. * * @param n the number of entries to skip */ public void skip(long n) { if (!hasNext()) { return; } if (n < 10) { while (n-- > 0) { fetchNext(); } return; } long index = map.getKeyIndex(current); K k = map.getKey(index + n); pos = null; min(root, k); fetchNext(); }
/** * Fetch the next entry if there is one. */ @SuppressWarnings("unchecked") private void fetchNext() { while (pos != null) { if (pos.index < pos.page.getKeyCount()) { int index = pos.index++; current = (K) pos.page.getKey(index); currentValue = (V) pos.page.getValue(index); return; } pos = pos.parent; if (pos == null) { break; } if (pos.index < map.getChildPageCount(pos.page)) { min(pos.page.getChildPage(pos.index++), null); } } current = null; }
/** * Skip over that many entries. This method is relatively fast (for this map * implementation) even if many entries need to be skipped. * * @param n the number of entries to skip */ public void skip(long n) { if (!hasNext()) { return; } if (n < 10) { while (n-- > 0) { fetchNext(); } return; } long index = map.getKeyIndex(current); K k = map.getKey(index + n); pos = null; min(root, k); fetchNext(); }
/** * Skip over that many entries. This method is relatively fast (for this map * implementation) even if many entries need to be skipped. * * @param n the number of entries to skip */ public void skip(long n) { if (!hasNext()) { return; } if (n < 10) { while (n-- > 0) { fetchNext(); } return; } long index = map.getKeyIndex(current); K k = map.getKey(index + n); pos = null; min(root, k); fetchNext(); }
/** * Fetch the next entry if there is one. */ @SuppressWarnings("unchecked") private void fetchNext() { while (pos != null) { if (pos.index < pos.page.getKeyCount()) { int index = pos.index++; current = (K) pos.page.getKey(index); currentValue = (V) pos.page.getValue(index); return; } pos = pos.parent; if (pos == null) { break; } if (pos.index < map.getChildPageCount(pos.page)) { min(pos.page.getChildPage(pos.index++), null); } } current = null; }
/** * Fetch the next entry if there is one. */ @SuppressWarnings("unchecked") private void fetchNext() { while (pos != null) { if (pos.index < pos.page.getKeyCount()) { int index = pos.index++; current = (K) pos.page.getKey(index); currentValue = (V) pos.page.getValue(index); return; } pos = pos.parent; if (pos == null) { break; } if (pos.index < map.getChildPageCount(pos.page)) { min(pos.page.getChildPage(pos.index++), null); } } current = null; }