@Override public void close() { if (this.itor.isOwningHandle()) { this.itor.close(); } } }
@Override public boolean hasNext() { this.matched = this.itor.isOwningHandle(); if (!this.matched) { // Maybe closed return this.matched; } this.matched = this.itor.isValid(); if (this.matched) { // Update position for paging this.position = this.itor.key(); // Do filter if not SCAN_ANY if (!this.match(Session.SCAN_ANY)) { this.matched = this.filter(this.position); } } if (!this.matched) { // The end this.position = null; // Free the iterator if finished this.close(); } return this.matched; }
@Override public void close() { if (this.itor.isOwningHandle()) { this.itor.close(); } } }
/** * <p>Return the value for the current entry. The underlying storage for * the returned slice is valid only until the next modification of * the iterator.</p> * * <p>REQUIRES: !AtEnd() && !AtStart()</p> * @return value for the current entry. */ public byte[] value() { assert(isOwningHandle()); return value0(nativeHandle_); }
/** * <p>Return the key for the current entry. The underlying storage for * the returned slice is valid only until the next modification of * the iterator.</p> * * <p>REQUIRES: {@link #isValid()}</p> * * @return key for the current entry. */ public byte[] key() { assert(isOwningHandle()); return key0(nativeHandle_); }
@Override public boolean hasNext() { this.matched = this.itor.isOwningHandle(); if (!this.matched) { // Maybe closed return this.matched; } this.matched = this.itor.isValid(); if (this.matched) { // Update position for paging this.position = this.itor.key(); // Do filter if not SCAN_ANY if (!this.match(Session.SCAN_ANY)) { this.matched = this.filter(this.position); } } if (!this.matched) { // The end this.position = null; // Free the iterator if finished this.close(); } return this.matched; }