1 /* 2 3 Derby - Class org.apache.derby.iapi.store.access.SortController 4 5 Licensed to the Apache Software Foundation (ASF) under one or more 6 contributor license agreements. See the NOTICE file distributed with 7 this work for additional information regarding copyright ownership. 8 The ASF licenses this file to you under the Apache License, Version 2.0 9 (the "License"); you may not use this file except in compliance with 10 the License. You may obtain a copy of the License at 11 12 http://www.apache.org/licenses/LICENSE-2.0 13 14 Unless required by applicable law or agreed to in writing, software 15 distributed under the License is distributed on an "AS IS" BASIS, 16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 See the License for the specific language governing permissions and 18 limitations under the License. 19 20 */ 21 22 package org.apache.derby.iapi.store.access; 23 24 import org.apache.derby.iapi.types.CloneableObject; 25 26 import org.apache.derby.iapi.types.DataValueDescriptor; 27 28 import org.apache.derby.iapi.error.StandardException; 29 30 31 /** 32 33 A sort controller is an interface for inserting rows 34 into a sort. 35 <p> 36 A sort is created with the createSort method of 37 TransactionController. The rows are read back with 38 a scan controller returned from the openSortScan 39 method of TranscationController. 40 41 42 @see TransactionController#openSort 43 @see ScanController 44 45 **/ 46 47 public interface SortController 48 { 49 /** 50 Close this sort controller. 51 <p> 52 Currently, since only one sort controller is allowed per sort, 53 closing the sort controller means the last row has been 54 inserted. 55 **/ 56 void close(); 57 58 /** 59 Insert a row into the sort. 60 61 @param row The row to insert into the conglomerate. The stored 62 representations of the row's columns are copied into a new row 63 somewhere in the conglomerate. 64 65 @exception StandardException Standard exception policy. 66 @see CloneableObject 67 **/ 68 void insert(DataValueDescriptor[] row) 69 throws StandardException; 70 71 72 /** 73 * Return SortInfo object which contains information about the current 74 * state of the sort. 75 * <p> 76 * 77 * @see SortInfo 78 * 79 * @return The SortInfo object which contains info about current sort. 80 * 81 * @exception StandardException Standard exception policy. 82 **/ 83 SortInfo getSortInfo() 84 throws StandardException; 85 86 87 } 88