Package org.h2.mvstore.db
Class MVPlainTempResult
- java.lang.Object
-
- org.h2.mvstore.db.MVTempResult
-
- org.h2.mvstore.db.MVPlainTempResult
-
- All Implemented Interfaces:
ResultExternal
class MVPlainTempResult extends MVTempResult
Plain temporary result.
-
-
Field Summary
Fields Modifier and Type Field Description private long
counter
Counter for the identities of rows.private Cursor<java.lang.Long,ValueRow>
cursor
Cursor for thenext()
method.private MVMap<java.lang.Long,ValueRow>
map
Map with identities of rows as keys rows as values.-
Fields inherited from class org.h2.mvstore.db.MVTempResult
childCount, closed, expressions, parent, resultColumnCount, rowCount, store, visibleColumnCount
-
-
Constructor Summary
Constructors Modifier Constructor Description (package private)
MVPlainTempResult(Database database, Expression[] expressions, int visibleColumnCount, int resultColumnCount)
Creates a new plain temporary result.private
MVPlainTempResult(MVPlainTempResult parent)
Creates a shallow copy of the result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
addRow(Value[] values)
Add a row to this object.boolean
contains(Value[] values)
Check if the given row exists in this object.ResultExternal
createShallowCopy()
Create a shallow copy of this object if possible.Value[]
next()
Get the next row from the result.int
removeRow(Value[] values)
Remove the row with the given values from this object if such a row exists.void
reset()
Reset the current position of this object.-
Methods inherited from class org.h2.mvstore.db.MVTempResult
addRows, close, of
-
-
-
-
Field Detail
-
map
private final MVMap<java.lang.Long,ValueRow> map
Map with identities of rows as keys rows as values.
-
counter
private long counter
Counter for the identities of rows. A separate counter is used instead ofMVTempResult.rowCount
because rows due to presence ofremoveRow(Value[])
method to ensure that each row will have an own identity.
-
-
Constructor Detail
-
MVPlainTempResult
private MVPlainTempResult(MVPlainTempResult parent)
Creates a shallow copy of the result.- Parameters:
parent
- parent result
-
MVPlainTempResult
MVPlainTempResult(Database database, Expression[] expressions, int visibleColumnCount, int resultColumnCount)
Creates a new plain temporary result. This result does not sort its rows, but it can be used in index-sorted queries and it can preserve additional columns for WITH TIES processing.- Parameters:
database
- databaseexpressions
- column expressionsvisibleColumnCount
- count of visible columnsresultColumnCount
- the number of columns including visible columns and additional virtual columns for ORDER BY clause
-
-
Method Detail
-
addRow
public int addRow(Value[] values)
Description copied from interface:ResultExternal
Add a row to this object.- Parameters:
values
- the row to add- Returns:
- the new number of rows in this object
-
contains
public boolean contains(Value[] values)
Description copied from interface:ResultExternal
Check if the given row exists in this object.- Parameters:
values
- the row- Returns:
- true if it exists
-
createShallowCopy
public ResultExternal createShallowCopy()
Description copied from interface:ResultExternal
Create a shallow copy of this object if possible.- Returns:
- the shallow copy, or null
-
next
public Value[] next()
Description copied from interface:ResultExternal
Get the next row from the result.- Returns:
- the next row or null
-
removeRow
public int removeRow(Value[] values)
Description copied from interface:ResultExternal
Remove the row with the given values from this object if such a row exists.- Parameters:
values
- the row- Returns:
- the new row count
-
reset
public void reset()
Description copied from interface:ResultExternal
Reset the current position of this object.
-
-