|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IRaba
Interface for random access to a logical byte[][]s. This is primarily used
for B+Tree keys and values, but is also used when serializing keys and values
for IIndexProcedures. The interface defines optional operations for
mutation. If mutation is supported, then isReadOnly() will return
false. An IRaba instance either stores B+Tree keys and
supports search(byte[]) -or- stores B+Tree values and allows
nulls but does not support search. for storing null
s and search are mutually exclusive. Some IRaba implementations may
be used for either purpose, but the IRaba instance is always either
B+Tree keys or B+Tree values. In both cases, the IRaba stores
variable length byte[]s. However, when an IRaba stores B+Tree keys,
the byte[]s interpreted as unsigned byte[]s for the purpose of
search(byte[]).
unsigned byte[] keys and
nulls ARE NOT permitted.
byte[]s, does NOT
support search(byte[]) and nulls are allowed.
add(byte[]) methods. It is
typically easier and more convenient to directly manage the existing
MutableKeyBuffer and MutableValueBuffer. However, there
are also MutableKeysRaba and MutableValueRaba
implementations which are, I believe, only used by the
ResultSet.| Method Summary | |
|---|---|
int |
add(byte[] a)
Append a byte[] value to the end of the logical byte[][] (optional operation). |
int |
add(byte[] value,
int off,
int len)
Append a byte[] value to the end of the logical byte[][] (optional operation). |
int |
add(DataInput in,
int len)
Append a byte[] value to the end of the logical byte[][] (optional operation). |
int |
capacity()
The capacity of the logical byte[][]. |
int |
copy(int index,
OutputStream os)
Copy the value at the specified index onto the output stream. |
byte[] |
get(int index)
Return the byte[] at the specified index. |
boolean |
isEmpty()
True iff the logical byte[][] is empty. |
boolean |
isFull()
True iff the logical byte[][] is full. |
boolean |
isKeys()
When true the IRaba supports search and elements are
interpreted as unsigned byte[]s (B+Tree keys). |
boolean |
isNull(int index)
Return true iff the byte[] at that index is
null. |
boolean |
isReadOnly()
Return true if this implementation is read-only. |
Iterator<byte[]> |
iterator()
Iterator visits the byte[] elements in the view order. |
int |
length(int index)
The length of the byte[] at that index. |
int |
search(byte[] searchKey)
Search for the given searchKey in the key buffer (optional operation). |
void |
set(int index,
byte[] a)
Set the byte[] value at the specified index (optional operation). |
int |
size()
The #of entries in the logical byte[][]. |
| Method Detail |
|---|
boolean isReadOnly()
true if this implementation is read-only.
boolean isKeys()
true the IRaba supports search and elements are
interpreted as unsigned byte[]s (B+Tree keys). For this case
the application MUST ensure that the elements are maintained in
unsigned byte[] order and that duplicates byte[]s are not
stored.
When false, the IRaba allows nulls and
the elements are interpreted as signed byte[] (B+Tree
values).
true if the IRaba represents B+Tree keys and
false if it represents B+Tree values.int capacity()
capacity == size while
only mutable rabas have a sense of capacity GTE size. Some of the
unit tests assume that all rabas are dimensions based on the
branching factor, which is no longer true. By moving this method
onto the mutable IRaba implementations we would uncover those
assumptions and clean things up a bit more.int size()
boolean isEmpty()
boolean isFull()
boolean isNull(int index)
true iff the byte[] at that index is
null. If isKeys() would return
true then this method MUST return false since
nulls are not permitted for B+Tree keys.
index - The index in [0:size()-1].
IndexOutOfBoundsException - unless index is in [0:size()-1].int length(int index)
index - The index in [0:size()-1].
NullPointerException - if the key at that index is null.
IndexOutOfBoundsException - unless index is in [0:size()-1].byte[] get(int index)
index - The index in [0:size()-1].
null if a
null value was stored at that index.
IndexOutOfBoundsException - unless index is in [0:size()-1].
int copy(int index,
OutputStream os)
ByteArrayBuffer so that the same backing
byte[] can be overwritten by each visited key.
index - The index in [0:size()-1].out - The output stream onto which the key will be copied.
IndexOutOfBoundsException - unless index is in [0:size()-1].
NullPointerException - if the byte[] value at that index is null.
RuntimeException - if the OutputStream throws an IOException
(generally the OutputStream is writing onto a byte[]
so it is more convenient to masquerade this exception).Iterator<byte[]> iterator()
null, then the iterator will report a null for
that element.
iterator in interface Iterable<byte[]>
void set(int index,
byte[] a)
index - The index in [0:size()-1].a - The byte[] value.
IndexOutOfBoundsException - unless index is in [0:size()-1].
IllegalArgumentException - if the value is null and null values are not
supported by this implementation.int add(byte[] a)
a - A value.
IllegalArgumentException - if the value is null and null values are not
supported by this implementation.
int add(byte[] value,
int off,
int len)
value - A valueoff - The offset of the first byte to be copied.len - The #of bytes to be copied.
IllegalArgumentException - if the value is null.
int add(DataInput in,
int len)
throws IOException
in - The input stream from which the byte[] will be read.len - The #of bytes to be read.
IllegalArgumentException - if in is null.
IOExceptionset(int, byte[]) that copies bytes
from an input stream?int search(byte[] searchKey)
entryIndex = -entryIndex - 1or just
entryIndex = -entryIndexif you are looking for the first key after the searchKey.
searchKey - The search key.
(-(insertion point) - 1). The insertion point is
defined as the point at which the key would be inserted. Note
that this guarantees that the return value will be >= 0 if and
only if the key is found.
IllegalArgumentException - if the searchKey is null.
UnsupportedOperationException - if search is not supported.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||