com.sleepycat.persist
Class DataValueAdapter<V>

java.lang.Object
  extended by com.sleepycat.persist.DataValueAdapter<V>
All Implemented Interfaces:
ValueAdapter<V>

 class DataValueAdapter<V>
extends java.lang.Object
implements ValueAdapter<V>

A ValueAdapter where the "value" is the data, although the data in this case is the primary key in a KeysIndex.

Author:
Mark Hayes

Constructor Summary
DataValueAdapter(java.lang.Class<V> keyClass, EntryBinding dataBinding)
           
 
Method Summary
 void clearEntries(DatabaseEntry key, DatabaseEntry pkey, DatabaseEntry data)
          Sets the data array of the given entries to null, based on knowledge of which entries are non-null and are not NO_RETURN_ENTRY.
 V entryToValue(DatabaseEntry key, DatabaseEntry pkey, DatabaseEntry data)
          Returns the appropriate "value" (key, primary key, or entity) using the appropriate bindings for that purpose.
 DatabaseEntry initData()
          Creates a DatabaseEntry for the data or returns null if the data is not needed.
 DatabaseEntry initKey()
          Creates a DatabaseEntry for the key or returns null if the key is not needed.
 DatabaseEntry initPKey()
          Creates a DatabaseEntry for the primary key or returns null if the primary key is not needed.
 void valueToData(V value, DatabaseEntry data)
          Converts an entity value to a data entry using an entity binding, or throws UnsupportedOperationException if this is not appropriate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataValueAdapter

DataValueAdapter(java.lang.Class<V> keyClass,
                 EntryBinding dataBinding)
Method Detail

initKey

public DatabaseEntry initKey()
Description copied from interface: ValueAdapter
Creates a DatabaseEntry for the key or returns null if the key is not needed.

Specified by:
initKey in interface ValueAdapter<V>

initPKey

public DatabaseEntry initPKey()
Description copied from interface: ValueAdapter
Creates a DatabaseEntry for the primary key or returns null if the primary key is not needed.

Specified by:
initPKey in interface ValueAdapter<V>

initData

public DatabaseEntry initData()
Description copied from interface: ValueAdapter
Creates a DatabaseEntry for the data or returns null if the data is not needed. BasicIndex.NO_RETURN_ENTRY may be returned if the data argument is required but we don't need it.

Specified by:
initData in interface ValueAdapter<V>

clearEntries

public void clearEntries(DatabaseEntry key,
                         DatabaseEntry pkey,
                         DatabaseEntry data)
Description copied from interface: ValueAdapter
Sets the data array of the given entries to null, based on knowledge of which entries are non-null and are not NO_RETURN_ENTRY.

Specified by:
clearEntries in interface ValueAdapter<V>

entryToValue

public V entryToValue(DatabaseEntry key,
                      DatabaseEntry pkey,
                      DatabaseEntry data)
Description copied from interface: ValueAdapter
Returns the appropriate "value" (key, primary key, or entity) using the appropriate bindings for that purpose.

Specified by:
entryToValue in interface ValueAdapter<V>

valueToData

public void valueToData(V value,
                        DatabaseEntry data)
Description copied from interface: ValueAdapter
Converts an entity value to a data entry using an entity binding, or throws UnsupportedOperationException if this is not appropriate. Called by BasicCursor.update.

Specified by:
valueToData in interface ValueAdapter<V>


Copyright 2004-2006 Sleepycat, Inc. All Rights Reserved.