Package com.healthmarketscience.jackcess
Interface IndexCursor
-
- All Known Implementing Classes:
IndexCursorImpl
public interface IndexCursor extends Cursor
Cursor backed by anIndexwith extended traversal options. Table traversal will be in the order defined by the backing index. Lookups which utilize the columns of the index will be fast.- Author:
- James Ahlborn
- Usage:
- General: This class is general use.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.healthmarketscience.jackcess.Cursor
Cursor.Id, Cursor.Position, Cursor.Savepoint
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancurrentRowMatchesEntry(Object... entryValues)Returnstrueif the current row matches the given index entries.voidfindClosestRowByEntry(Object... entryValues)Moves to the first row (as defined by the cursor) where the index entries are >= the given values.booleanfindFirstRowByEntry(Object... entryValues)Moves to the first row (as defined by the cursor) where the index entries match the given values.RowfindRowByEntry(Object... entryValues)Finds the first row (as defined by the cursor) where the index entries match the given values.IndexgetIndex()EntryIterableBuildernewEntryIterable(Object... entryValues)Convenience method for constructing a new EntryIterableBuilder for this cursor.-
Methods inherited from interface com.healthmarketscience.jackcess.Cursor
afterLast, beforeFirst, currentRowMatches, currentRowMatches, deleteCurrentRow, findFirstRow, findFirstRow, findNextRow, findNextRow, findRow, getColumnMatcher, getCurrentRow, getCurrentRow, getCurrentRowValue, getErrorHandler, getId, getNextRow, getNextRow, getPreviousRow, getPreviousRow, getSavepoint, getTable, isAfterLast, isBeforeFirst, isCurrentRowDeleted, iterator, moveNextRows, movePreviousRows, moveToNextRow, moveToPreviousRow, newIterable, reset, restoreSavepoint, setColumnMatcher, setCurrentRowValue, setErrorHandler, stream, updateCurrentRow, updateCurrentRowFromMap
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
getIndex
Index getIndex()
-
findRowByEntry
Row findRowByEntry(Object... entryValues) throws IOException
Finds the first row (as defined by the cursor) where the index entries match the given values. If a match is not found (or an exception is thrown), the cursor is restored to its previous state.- Parameters:
entryValues- the column values for the index's columns.- Returns:
- the matching row or
nullif a match could not be found. - Throws:
IOException
-
findFirstRowByEntry
boolean findFirstRowByEntry(Object... entryValues) throws IOException
Moves to the first row (as defined by the cursor) where the index entries match the given values. If a match is not found (or an exception is thrown), the cursor is restored to its previous state.Warning, this method always starts searching from the beginning of the Table (you cannot use it to find successive matches).
- Parameters:
entryValues- the column values for the index's columns.- Returns:
trueif a valid row was found with the given values,falseif no row was found- Throws:
IOException
-
findClosestRowByEntry
void findClosestRowByEntry(Object... entryValues) throws IOException
Moves to the first row (as defined by the cursor) where the index entries are >= the given values. If a an exception is thrown, the cursor is restored to its previous state.- Parameters:
entryValues- the column values for the index's columns.- Throws:
IOException
-
currentRowMatchesEntry
boolean currentRowMatchesEntry(Object... entryValues) throws IOException
Returnstrueif the current row matches the given index entries.- Parameters:
entryValues- the column values for the index's columns.- Throws:
IOException
-
newEntryIterable
EntryIterableBuilder newEntryIterable(Object... entryValues)
Convenience method for constructing a new EntryIterableBuilder for this cursor. An EntryIterableBuilder provides a variety of options for more flexible iteration based on a specific index entry.- Parameters:
entryValues- the column values for the index's columns.
-
-