File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\result\ResultExternal.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.result;
8
9 import java.util.ArrayList;
10 import org.h2.value.Value;
11
12 /**
13 * This interface is used to extend the LocalResult class, if data does not fit
14 * in memory.
15 */
16 public interface ResultExternal {
17
18 /**
19 * Reset the current position of this object.
20 */
21 void reset();
22
23 /**
24 * Get the next row from the result.
25 *
26 * @return the next row or null
27 */
28 Value[] next();
29
30 /**
31 * Add a row to this object.
32 *
33 * @param values the row to add
34 * @return the new number of rows in this object
35 */
36 int addRow(Value[] values);
37
38 /**
39 * Add a number of rows to the result.
40 *
41 * @param rows the list of rows to add
42 * @return the new number of rows in this object
43 */
44 int addRows(ArrayList<Value[]> rows);
45
46 /**
47 * This method is called after all rows have been added.
48 */
49 void done();
50
51 /**
52 * Close this object and delete the temporary file.
53 */
54 void close();
55
56 /**
57 * Remove the row with the given values from this object if such a row
58 * exists.
59 *
60 * @param values the row
61 * @return the new row count
62 */
63 int removeRow(Value[] values);
64
65 /**
66 * Check if the given row exists in this object.
67 *
68 * @param values the row
69 * @return true if it exists
70 */
71 boolean contains(Value[] values);
72
73 /**
74 * Create a shallow copy of this object if possible.
75 *
76 * @return the shallow copy, or null
77 */
78 ResultExternal createShallowCopy();
79
80 }
81