Class SortScan
java.lang.Object
org.apache.derby.impl.store.access.sort.Scan
org.apache.derby.impl.store.access.sort.SortScan
- All Implemented Interfaces:
ScanManager, GenericScanController, GroupFetchScanController, RowCountable, ScanController, ScanInfo
- Direct Known Subclasses:
MergeScan, SortBufferScan
Abstract base class for merge sort scans.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataValueDescriptor[]The row at the current position of the scan, from which fetch will return values.protected booleanThe row at the current position of the scan, from which fetch will return values.protected MergeSortThe sort that this class is scanning.protected TransactionManagerThe transactionManager that opened this scan.Fields inherited from interface ScanController
GE, GT, NA -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the scan.final voidfetch(DataValueDescriptor[] result) Fetch the row at the current position of the Scan.final booleanfetchNext(DataValueDescriptor[] row) Fetch the row at the next position of the Scan.final voidfetchWithoutQualify(DataValueDescriptor[] result) Fetch the row at the current position of the Scan and does not apply the qualifiers.Methods inherited from class Scan
delete, didNotQualify, doesCurrentPositionQualify, fetchLocation, fetchNextGroup, fetchNextGroup, fetchSet, getAllScanInfo, getEstimatedRowCount, getScanInfo, isCurrentPositionDeleted, isHeldAfterCommit, isKeyed, isTableLocked, newRowLocationTemplate, positionAtRowLocation, reopenScan, reopenScanByRowLocation, replace, setEstimatedRowCountMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GroupFetchScanController
nextMethods inherited from interface ScanController
nextMethods inherited from interface ScanManager
closeForEndTransaction
-
Field Details
-
sort
The sort that this class is scanning. -
tran
The transactionManager that opened this scan. -
current
The row at the current position of the scan, from which fetch will return values. -
hold
protected boolean holdThe row at the current position of the scan, from which fetch will return values.
-
-
Constructor Details
-
SortScan
SortScan(MergeSort sort, TransactionManager tran, boolean hold)
-
-
Method Details
-
fetchNext
Fetch the row at the next position of the Scan. If there is a valid next position in the scan then the value in the template storable row is replaced with the value of the row at the current scan position. The columns of the template row must be of the same type as the actual columns in the underlying conglomerate. The resulting contents of templateRow after a fetchNext() which returns false is undefined. The result of calling fetchNext(row) is exactly logically equivalent to making a next() call followed by a fetch(row) call. This interface allows implementations to optimize the 2 calls if possible. RESOLVE (mikem - 2/24/98) - come back to this and see if coding this differently saves in sort scans, as did the heap recoding.- Parameters:
row- The template row into which the value of the next position in the scan is to be stored.- Returns:
- True if there is a next position in the scan, false if there isn't.
- Throws:
StandardException- Standard exception policy.- See Also:
-
fetch
Fetch the row at the current position of the Scan.- Parameters:
result- The row into which the value of the current position in the scan is to be stored.- Throws:
StandardException- Standard exception policy.- See Also:
-
fetchWithoutQualify
Fetch the row at the current position of the Scan and does not apply the qualifiers. This method will always throw an exception. (SQLState.SORT_IMPROPER_SCAN_METHOD)- Parameters:
result- The row into which the value of the current position in the scan is to be stored.- Throws:
StandardException- Standard exception policy.- See Also:
-
close
public void close()Close the scan. @see ScanController#close
-