Add more iterator JNI bindings

This commit is contained in:
Ankit Gupta
2014-04-19 12:55:28 -07:00
parent eda398491a
commit 1d6c1e018f
4 changed files with 114 additions and 6 deletions

View File

@@ -37,6 +37,26 @@ public class Iterator {
prev0(nativeHandle_);
}
public byte[] key() {
assert(isInitialized());
return key0(nativeHandle_);
}
public byte[] value() {
assert(isInitialized());
return value0(nativeHandle_);
}
public void seek(byte[] target) {
assert(isInitialized());
seek0(nativeHandle_, target, target.length);
}
public void status(){
assert(isInitialized());
status0(nativeHandle_);
}
public synchronized void close() {
if(nativeHandle_ != 0) {
close0(nativeHandle_);
@@ -57,4 +77,8 @@ public class Iterator {
private native void seekToLast0(long handle);
private native void next0(long handle);
private native void prev0(long handle);
private native byte[] key0(long handle);
private native byte[] value0(long handle);
private native void seek0(long handle, byte[] target, int targetLen);
private native void status0(long handle);
}