Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*-
   * See the file LICENSE for redistribution information.
   *
   * Copyright (c) 2002, 2013 Oracle and/or its affiliates.  All rights reserved.
   *
   */
  
  package com.sleepycat.persist;
  
 
 /* <!-- begin JE only --> */
 /* <!-- end JE only --> */
 /* <!-- begin JE only --> */
 /* <!-- end JE only --> */

Cursor operations limited to traversing forward. See EntityCursor for general information on cursors.

ForwardCursor objects are not thread-safe. Cursors should be opened, used and closed by a single thread.

WARNING: Cursors must always be closed to prevent resource leaks which could lead to the index becoming unusable or cause an OutOfMemoryError. To ensure that a cursor is closed in the face of exceptions, close it in a finally block.

Author(s):
Mark Hayes
 
 public interface ForwardCursor<V> extends Iterable<V>
     /* <!-- begin JE only --> */
     , Closeable
     /* <!-- end JE only --> */
     {

    
Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range. If the cursor is uninitialized, this method returns the first value.

com.sleepycat.je.LockMode.DEFAULT is used implicitly.

Returns:
the next value, or null if there are no more values in the cursor range.
Throws:
com.sleepycat.je.OperationFailureException if one of the Read Operation Failures occurs.
com.sleepycat.je.EnvironmentFailureException if an unexpected, internal or environment-wide failure occurs.
com.sleepycat.je.DatabaseException the base class for all BDB exceptions.
 
     V next()
         throws DatabaseException;

    
Moves the cursor to the next value and returns it, or returns null if there are no more values in the cursor range. If the cursor is uninitialized, this method returns the first value.

Parameters:
lockMode the lock mode to use for this operation, or null to use com.sleepycat.je.LockMode.DEFAULT.
Returns:
the next value, or null if there are no more values in the cursor range.
Throws:
com.sleepycat.je.OperationFailureException if one of the Read Operation Failures occurs.
com.sleepycat.je.EnvironmentFailureException if an unexpected, internal or environment-wide failure occurs.
com.sleepycat.je.DatabaseException the base class for all BDB exceptions.
 
     V next(LockMode lockMode)
         throws DatabaseException;

    
Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.

com.sleepycat.je.LockMode.DEFAULT is used implicitly.

Returns:
the iterator.
 
    Iterator<V> iterator();

    
Returns an iterator over the key range, starting with the value following the current position or at the first value if the cursor is uninitialized.

Parameters:
lockMode the lock mode to use for all operations performed using the iterator, or null to use com.sleepycat.je.LockMode.DEFAULT.
Returns:
the iterator.
    Iterator<V> iterator(LockMode lockMode);

    
Closes the cursor.

Throws:
com.sleepycat.je.DatabaseException the base class for all BDB exceptions.
    void close()
        throws DatabaseException;
New to GrepCode? Check out our FAQ X