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 EntityIndex returned by SecondaryIndex.keysIndex(). This index maps secondary key to primary key. In Berkeley DB internal terms, this is a secondary database that is opened without associating it with a primary.

Mark Hayes
class KeysIndex<SK, PK> extends BasicIndex<SK, PK> {
    private EntryBinding pkeyBinding;
    private SortedMap<SK, PK> map;
    KeysIndex(Database db,
              Class<SK> keyClass,
              EntryBinding keyBinding,
              Class<PK> pkeyClass,
              EntryBinding pkeyBinding)
        throws DatabaseException {
              new DataValueAdapter<PK>(pkeyClasspkeyBinding));
        this. = pkeyBinding;
     * Of the EntityIndex methods only get()/map()/sortedMap() are implemented
     * here.  All other methods are implemented by BasicIndex.
    public PK get(SK key)
        throws DatabaseException {
        return get(nullkeynull);
    public PK get(Transaction txn, SK keyLockMode lockMode)
        throws DatabaseException {
        DatabaseEntry keyEntry = new DatabaseEntry();
        DatabaseEntry pkeyEntry = new DatabaseEntry();
        OperationStatus status = .get(txnkeyEntrypkeyEntrylockMode);
        if (status == .) {
            return (PK) .entryToObject(pkeyEntry);
        } else {
            return null;
    public Map<SK, PK> map() {
        return sortedMap();
    public synchronized SortedMap<SK, PK> sortedMap() {
        if ( == null) {
             = new StoredSortedMap(false);
        return ;
    boolean isUpdateAllowed() {
        return false;
New to GrepCode? Check out our FAQ X