Package org.h2.index
Class IndexCursor
java.lang.Object
org.h2.index.IndexCursor
- All Implemented Interfaces:
Cursor
The filter used to walk through an index. This class supports IN(..)
and IN(SELECT ...) optimizations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanUseIndexForIn(Index index, Column[] columns) ReturntrueifIndex.getIndexColumns()and thecolumnsparameter contains the same elements in the same order.voidfind(SessionLocal s, ArrayList<IndexCondition> indexConditions) Re-evaluate the start and end values of the index search for rows.get()Get the complete current row.getEnd()Get end search row.Get the current row.getStart()Get start search row.booleanCheck if the result is empty for sure.booleannext()Skip to the next row if one is available.voidprepare(SessionLocal s, ArrayList<IndexCondition> indexConditions) Prepare this index cursor to make a lookup in index.booleanprevious()Skip to the previous row if one is available.void
-
Constructor Details
-
IndexCursor
public IndexCursor()
-
-
Method Details
-
setIndex
-
prepare
Prepare this index cursor to make a lookup in index.- Parameters:
s- Session.indexConditions- Index conditions.
-
find
Re-evaluate the start and end values of the index search for rows.- Parameters:
s- the sessionindexConditions- the index conditions
-
canUseIndexForIn
ReturntrueifIndex.getIndexColumns()and thecolumnsparameter contains the same elements in the same order. All column of the index must match the column in thecolumnsarray, or it must be a VIEW index (where the column is null).- See Also:
-
isAlwaysFalse
public boolean isAlwaysFalse()Check if the result is empty for sure.- Returns:
- true if it is
-
getStart
Get start search row.- Returns:
- search row
-
getEnd
Get end search row.- Returns:
- search row
-
get
Description copied from interface:CursorGet the complete current row. All column are available. -
getSearchRow
Description copied from interface:CursorGet the current row. Only the data for indexed columns is available in this row.- Specified by:
getSearchRowin interfaceCursor- Returns:
- the search row
-
next
public boolean next()Description copied from interface:CursorSkip to the next row if one is available. -
previous
public boolean previous()Description copied from interface:CursorSkip to the previous row if one is available. No filtering is made here.
-