Constructor and Description |
---|
SubRangeRaba(IRaba delegate,
int fromIndex,
int toIndex) |
Modifier and Type | Method and Description |
---|---|
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()
|
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[][].
|
String |
toString() |
public SubRangeRaba(IRaba delegate, int fromIndex, int toIndex)
delegate
- The delegatefromIndex
- The inclusive lower bound in the delegate.toIndex
- The exclusive upper bound in the delegate.IllegalArgumentException
- if the delegate is null.IllegalArgumentException
- if the fromIndex is LT ZERO (0).IllegalArgumentException
- if the toIndex is GT the delegate IRaba.size()
.IllegalArgumentException
- if the fromIndex is GTE to toIndex.public final boolean isReadOnly()
IRaba
true
if this implementation is read-only.isReadOnly
in interface IRaba
public boolean isKeys()
IRaba
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 null
s and
the elements are interpreted as signed byte[]
(B+Tree
values).
public int capacity()
IRaba
public int size()
IRaba
public boolean isEmpty()
IRaba
public boolean isFull()
It is assumed that the delegate is full and this view does not allow
mutation, so this always returns false
.
public boolean isNull(int index)
IRaba
true
iff the byte[] at that index is
null
. If IRaba.isKeys()
would return
true
then this method MUST return false
since
null
s are not permitted for B+Tree keys.isNull
in interface IRaba
index
- The index in [0:IRaba.size()
-1].public int length(int index)
IRaba
length
in interface IRaba
index
- The index in [0:IRaba.size()
-1].public byte[] get(int index)
IRaba
get
in interface IRaba
index
- The index in [0:IRaba.size()
-1].null
if a
null
value was stored at that index.public int copy(int index, OutputStream os)
IRaba
ByteArrayBuffer
so that the same backing
byte[] can be overwritten by each visited key.copy
in interface IRaba
index
- The index in [0:IRaba.size()
-1].public Iterator<byte[]> iterator()
IRaba
null
, then the iterator will report a null
for
that element.public void set(int index, byte[] a)
IRaba
set
in interface IRaba
index
- The index in [0:IRaba.size()
-1].a
- The byte[] value.public int add(byte[] a)
IRaba
public int add(byte[] value, int off, int len)
IRaba
public int add(DataInput in, int len) throws IOException
IRaba
add
in interface IRaba
in
- The input stream from which the byte[] will be read.len
- The #of bytes to be read.IOException
public int search(byte[] searchKey)
entryIndex = -entryIndex - 1or just
entryIndex = -entryIndexif you are looking for the first key after the searchKey.
search
in interface IRaba
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.UnsupportedOperationException
- always.
TODO I am not sure about the semantics of search() for a
sub-range so it is just disallowed for now. The issue is the
meaning of a key probe that is LT the key at fromIndex in the
delegate or GTE the key at toIndex in the delegate. Search in
fact can generally report positions before the start of an
ordered array of keys or after their end. But in this case we
can't see any keys before fromIndex or GTE toIndex. This
leads to some ambiguity about how to respond to key probes
that really below in a different SubRangeRaba
.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.