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;
 
The cursor for a SubIndex treats Dup and NoDup operations specially because the SubIndex never has duplicates -- the keys are primary keys. So a next/prevDup operation always returns null, and a next/prevNoDup operation actually does next/prev.

Author(s):
Mark Hayes
class SubIndexCursor<V> extends BasicCursor<V> {
    SubIndexCursor(RangeCursor cursorValueAdapter<V> adapter) {
        super(cursoradapterfalse/*updateAllowed*/);
    }
    @Override
    public EntityCursor<V> dup()
        throws DatabaseException {
        return new SubIndexCursor<V>(.dup(true), );
    }
    @Override
    public V nextDup(LockMode lockMode) {
        checkInitialized();
        return null;
    }
    @Override
    public V nextNoDup(LockMode lockMode)
        throws DatabaseException {
        return returnValue(.getNext(lockMode));
    }
    @Override
    public V prevDup(LockMode lockMode) {
        checkInitialized();
        return null;
    }
    @Override
    public V prevNoDup(LockMode lockMode)
        throws DatabaseException {
        return returnValue(.getPrev(lockMode));
    }
New to GrepCode? Check out our FAQ X