com.healthmarketscience.jackcess
Interface IndexCursor

All Superinterfaces:
Cursor, Iterable<Row>
All Known Implementing Classes:
IndexCursorImpl

public interface IndexCursor
extends Cursor

Cursor backed by an Index with 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
 boolean currentRowMatchesEntry(Object... entryValues)
          Returns true if the current row matches the given index entries.
 void findClosestRowByEntry(Object... entryValues)
          Moves to the first row (as defined by the cursor) where the index entries are >= the given values.
 boolean findFirstRowByEntry(Object... entryValues)
          Moves to the first row (as defined by the cursor) where the index entries match the given values.
 Row findRowByEntry(Object... entryValues)
          Finds the first row (as defined by the cursor) where the index entries match the given values.
 Index getIndex()
           
 EntryIterableBuilder newEntryIterable(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, updateCurrentRow, updateCurrentRowFromMap
 

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 null if 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:
true if a valid row was found with the given values, false if 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
Returns true if 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.


Copyright © 2005–2017 Health Market Science. All rights reserved.