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.
    • 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.