| com.quadcap.sql.index.BIndex
All known Subclasses: com.quadcap.sql.index.Btree,
BIndex | public interface BIndex (Code) | | An index is simply a map, with byte arrays as keys.
author: Stan Bailes |
Method Summary | |
public boolean | delete(byte[] key) Delete the specified key. | public void | free() | public int | get(byte[] key, int len, byte[] data) Get the data bytes for the specified key. | public Comparator | getComparator() | public BCursor | getCursor(boolean skipSetup) Obtain a cursor for most wondrously manipulating this index. | public void | insert(byte[] key, int klen, byte[] data, int off, int len) Add a new key. | public boolean | set(byte[] key, int klen, byte[] data, int off, int len) Set the key/data pair, replacing any any value it may present in
a unique index, inserting a new values, whatever. | public void | update(byte[] key, int klen, byte[] data, int off, int len) Update the data value for an existing key. |
delete | public boolean delete(byte[] key) throws IOException(Code) | | Delete the specified key. Return true if the key was deleted.
|
get | public int get(byte[] key, int len, byte[] data) throws IOException(Code) | | Get the data bytes for the specified key. If the key is found, return
the length of the data portion and place as many bytes as will fit in the
data array. If the key isn't found, return -1.
|
getComparator | public Comparator getComparator()(Code) | | Return this index's comparator
|
getCursor | public BCursor getCursor(boolean skipSetup) throws IOException(Code) | | Obtain a cursor for most wondrously manipulating this index.
|
insert | public void insert(byte[] key, int klen, byte[] data, int off, int len) throws IOException(Code) | | Add a new key. If the index is a UNIQUE index, then
the new key/data pair will only be added if the key does not already
exist, otherwise, insert will do nothing and return false
The existing value must not exist or an IOException will be thrown.
Otherwise, the new key/data pair is added regardless.
|
set | public boolean set(byte[] key, int klen, byte[] data, int off, int len) throws IOException(Code) | | Set the key/data pair, replacing any any value it may present in
a unique index, inserting a new values, whatever. Return
true if the key already existed before this operation.
|
update | public void update(byte[] key, int klen, byte[] data, int off, int len) throws IOException(Code) | | Update the data value for an existing key. This only works for
UNIQUE indexes, and only if the specified key already exists.
exception: IOException - may be thrown. |
|
|