com.sleepycat.persist.impl
Class PersistKeyBinding

java.lang.Object
  extended by com.sleepycat.persist.impl.PersistKeyBinding
All Implemented Interfaces:
EntryBinding

public class PersistKeyBinding
extends Object
implements EntryBinding

A persistence key binding for a given key class.

Author:
Mark Hayes

Field Summary
(package private)  Catalog catalog
           
(package private)  Format keyFormat
           
(package private)  boolean rawAccess
           
 
Constructor Summary
PersistKeyBinding(Catalog catalog, Class cls, String[] compositeFieldOrder)
          Creates a key binding dynamically for use by PersistComparator.
PersistKeyBinding(Catalog catalogParam, String clsName, boolean rawAccess)
          Creates a key binding for a given key class.
 
Method Summary
(package private)  Object bytesToObject(byte[] bytes, int offset, int length)
          Binds bytes to an object for use by PersistComparator as well as entryToObject.
 Object entryToObject(DatabaseEntry entry)
          Converts a entry buffer into an Object.
 void objectToEntry(Object object, DatabaseEntry entry)
          Converts an Object into a entry buffer.
(package private) static Object readKey(Format keyFormat, Catalog catalog, byte[] bytes, int offset, int length, boolean rawAccess)
          Binds bytes to an object for use by PersistComparator as well as entryToObject.
(package private)  void refresh(PersistCatalog newCatalog)
          See Store.refresh.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

catalog

volatile Catalog catalog

keyFormat

volatile Format keyFormat

rawAccess

final boolean rawAccess
Constructor Detail

PersistKeyBinding

public PersistKeyBinding(Catalog catalogParam,
                         String clsName,
                         boolean rawAccess)
Creates a key binding for a given key class.


PersistKeyBinding

PersistKeyBinding(Catalog catalog,
                  Class cls,
                  String[] compositeFieldOrder)
Creates a key binding dynamically for use by PersistComparator. Formats are created from scratch rather than using a shared catalog.

Method Detail

bytesToObject

Object bytesToObject(byte[] bytes,
                     int offset,
                     int length)
               throws RefreshException
Binds bytes to an object for use by PersistComparator as well as entryToObject.

Throws:
RefreshException

readKey

static Object readKey(Format keyFormat,
                      Catalog catalog,
                      byte[] bytes,
                      int offset,
                      int length,
                      boolean rawAccess)
               throws RefreshException
Binds bytes to an object for use by PersistComparator as well as entryToObject.

Throws:
RefreshException

entryToObject

public Object entryToObject(DatabaseEntry entry)
Description copied from interface: EntryBinding
Converts a entry buffer into an Object.

Specified by:
entryToObject in interface EntryBinding
Parameters:
entry - is the source entry buffer.
Returns:
the resulting Object.

objectToEntry

public void objectToEntry(Object object,
                          DatabaseEntry entry)
Description copied from interface: EntryBinding
Converts an Object into a entry buffer.

Specified by:
objectToEntry in interface EntryBinding
Parameters:
object - is the source Object.
entry - is the destination entry buffer.

refresh

void refresh(PersistCatalog newCatalog)
See Store.refresh.



Copyright (c) 2004-2012 Oracle. All rights reserved.