public Cursor findFirstOrLast(Session session, boolean first) throws SQLException { Cursor cursor; if (first) { cursor = mainIndex.find(session, Long.MIN_VALUE, Long.MAX_VALUE, false); } else { long x = mainIndex.getLastKey(); cursor = mainIndex.find(session, x, x, false); } cursor.next(); return cursor; }
public Cursor find(Session session, SearchRow first, SearchRow last) throws SQLException { long min = mainIndex.getLong(first, Long.MIN_VALUE); long max = mainIndex.getLong(last, Long.MAX_VALUE); return mainIndex.find(session, min, max, false); }