diff src/org/dancres/blitz/entry/TupleLocator.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/dancres/blitz/entry/TupleLocator.java	Sat Mar 21 11:00:06 2009 +0000
@@ -0,0 +1,34 @@
+package org.dancres.blitz.entry;
+
+import java.io.IOException;
+
+import org.dancres.blitz.oid.OID;
+
+/**
+   All searches, whether they are performed in-memory or on-disk, result
+   in TupleLocators which are then used to iterate over the results.
+   Returned results are always UIDImpls which are then used to load
+   an appropriate EntrySleeve via SleeveCache (this ensures correct state is
+   maintained as the request to load a sleeve will make it's way into
+   an ArcCache then the WriteBuffer and then disk storage).
+ */
+public interface TupleLocator {
+    /**
+       Invoke this to load the next matching Tuple.
+
+       @return <code>true</code> if there was a tuple, <code>false</code>
+       otherwise
+     */
+    boolean fetchNext() throws IOException;
+
+    /**
+       @return the OID of the tuple just fetched with
+       <code>fetchNext</code>
+     */
+    OID getOID();
+
+    /**
+       When you've finished with the TupleLocator instance, call release.
+     */
+    void release() throws IOException;
+}