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
public abstract class SortScan extends Scan
Abstract base class for merge sort scans.
-
-
Field Summary
Fields Modifier and Type Field Description protected DataValueDescriptor[]
current
The row at the current position of the scan, from which fetch will return values.protected boolean
hold
The row at the current position of the scan, from which fetch will return values.protected MergeSort
sort
The sort that this class is scanning.protected TransactionManager
tran
The transactionManager that opened this scan.-
Fields inherited from interface org.apache.derby.iapi.store.access.ScanController
GE, GT, NA
-
-
Constructor Summary
Constructors Constructor Description SortScan(MergeSort sort, TransactionManager tran, boolean hold)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the scan.void
fetch(DataValueDescriptor[] result)
Fetch the row at the current position of the Scan.boolean
fetchNext(DataValueDescriptor[] row)
Fetch the row at the next position of the Scan.void
fetchWithoutQualify(DataValueDescriptor[] result)
Fetch the row at the current position of the Scan and does not apply the qualifiers.-
Methods inherited from class org.apache.derby.impl.store.access.sort.Scan
delete, didNotQualify, doesCurrentPositionQualify, fetchLocation, fetchNextGroup, fetchNextGroup, fetchSet, getAllScanInfo, getEstimatedRowCount, getScanInfo, isCurrentPositionDeleted, isHeldAfterCommit, isKeyed, isTableLocked, newRowLocationTemplate, positionAtRowLocation, reopenScan, reopenScanByRowLocation, replace, setEstimatedRowCount
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.derby.iapi.store.access.GroupFetchScanController
next
-
Methods inherited from interface org.apache.derby.iapi.store.access.ScanController
next
-
Methods inherited from interface org.apache.derby.iapi.store.access.conglomerate.ScanManager
closeForEndTransaction
-
-
-
-
Field Detail
-
sort
protected MergeSort sort
The sort that this class is scanning.
-
tran
protected TransactionManager tran
The transactionManager that opened this scan.
-
current
protected DataValueDescriptor[] current
The row at the current position of the scan, from which fetch will return values.
-
hold
protected boolean hold
The row at the current position of the scan, from which fetch will return values.
-
-
Constructor Detail
-
SortScan
SortScan(MergeSort sort, TransactionManager tran, boolean hold)
-
-
Method Detail
-
fetchNext
public final boolean fetchNext(DataValueDescriptor[] row) throws StandardException
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:
ScanController.fetch(org.apache.derby.iapi.types.DataValueDescriptor[])
,RowUtil
-
fetch
public final void fetch(DataValueDescriptor[] result) throws StandardException
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:
ScanController.fetch(org.apache.derby.iapi.types.DataValueDescriptor[])
-
fetchWithoutQualify
public final void fetchWithoutQualify(DataValueDescriptor[] result) throws StandardException
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:
ScanController.fetchWithoutQualify(org.apache.derby.iapi.types.DataValueDescriptor[])
-
close
public void close()
Close the scan. @see ScanController#close
-
-