42 |
public interface IndexedPool extends StormPool { |
public interface IndexedPool extends StormPool { |
43 |
|
|
44 |
final class Mapping { |
final class Mapping { |
45 |
|
public final Block block; |
46 |
public final byte[] key, value; |
public final byte[] key, value; |
47 |
public Mapping(byte[] k, byte[] v) { key=k; value=v; } |
public Mapping(Block b, byte[] k, byte[] v) { |
48 |
|
block=b; key=k; value=v; |
49 |
|
} |
50 |
} |
} |
51 |
|
|
52 |
interface DB { |
interface DB { |
60 |
/** |
/** |
61 |
* @return The set of <code>IndexedPool.Mapping</code>s |
* @return The set of <code>IndexedPool.Mapping</code>s |
62 |
* this index wants to extract from this block. |
* this index wants to extract from this block. |
63 |
|
* The <code>block</code> field of each |
64 |
|
* returned <code>Mapping</code> must contain |
65 |
|
* the block passed to this method; if this |
66 |
|
* isn't satisfied, an exception will be thrown. |
67 |
|
* (XXX specify which and where...) |
68 |
*/ |
*/ |
69 |
Set process(Block b); |
Set process(Block b); |
70 |
|
|
78 |
* provide very different interfaces; therefore, we simply |
* provide very different interfaces; therefore, we simply |
79 |
* return an <code>Object</code> that has to be cast |
* return an <code>Object</code> that has to be cast |
80 |
* to the desired interface first. |
* to the desired interface first. |
81 |
|
* @param pool The <code>IndexedPool</code> this index |
82 |
|
* will belong to. |
83 |
|
* @param db A <code>IndexedPool.DB</code> object |
84 |
|
* storing this index type's <code>Mapping</code>s-- |
85 |
|
* i.e., the back-end of the index. |
86 |
*/ |
*/ |
87 |
Object createIndex(DB db); |
Object createIndex(IndexedPool pool, DB db); |
88 |
|
|
89 |
String getIndexTypeURI(); |
String getIndexTypeURI(); |
90 |
} |
} |