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 Details

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

  • Method Details

    • 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:
    • 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:
    • 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:
    • close

      public void close()
      Close the scan. @see ScanController#close