| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| package io.v.syncbase.v23.services.syncbase.nosql; |
| |
| import io.v.v23.verror.VException; |
| |
| /** |
| * An interface for iterating through a collection of key/value pairs (obtained via |
| * {@link Table#scan Table.scan()}). |
| */ |
| public interface ScanStream extends Stream { |
| /** |
| * Returns the key of the element that was staged by {@link #advance}. |
| * <p> |
| * This method does not block. |
| * |
| * @throws VException if {@link #advance} returned {@code false} or was not called at all |
| */ |
| String key() throws VException; |
| |
| /** |
| * Returns the value of the element that was staged by {@link #advance}. |
| * <p> |
| * This method does not block. |
| * |
| * @throws VException if the value could not be decoded or if {@link #advance} returned |
| * {@code false} or was not called at all |
| */ |
| Object value() throws VException; |
| } |