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, String clsName, boolean rawAccess)
          Creates a key binding for a given key class.
PersistKeyBinding(Class cls, String[] compositeFieldOrder)
          Creates a key binding dynamically for use by PersistComparator.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

catalog

Catalog catalog

keyFormat

Format keyFormat

rawAccess

boolean rawAccess
Constructor Detail

PersistKeyBinding

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


PersistKeyBinding

PersistKeyBinding(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)
Binds bytes to an object for use by PersistComparator as well as entryToObject.


readKey

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.


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.


Copyright 2004,2008 Oracle. All rights reserved.