Berkeley DB
version 4.8.30

com.sleepycat.bind.tuple
Class TupleTupleMarshalledBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>

java.lang.Object
  extended by com.sleepycat.bind.tuple.TupleBase<E>
      extended by com.sleepycat.bind.tuple.TupleTupleBinding<E>
          extended by com.sleepycat.bind.tuple.TupleTupleMarshalledBinding<E>
All Implemented Interfaces:
EntityBinding<E>

public class TupleTupleMarshalledBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
extends TupleTupleBinding<E>

A concrete TupleTupleBinding that delegates to the MarshalledTupleEntry and MarshalledTupleKeyEntity interfaces of the entity class.

This class calls the methods of the MarshalledTupleEntry interface to convert between the data entry and entity object. It calls the methods of the MarshalledTupleKeyEntity interface to convert between the key entry and the entity object. These two interfaces must both be implemented by the entity class.


Constructor Summary
TupleTupleMarshalledBinding(Class<E> cls)
          Creates a tuple-tuple marshalled binding object.
 
Method Summary
 E entryToObject(TupleInput keyInput, TupleInput dataInput)
          Constructs an entity object from TupleInput key and data entries.
 void objectToData(E object, TupleOutput output)
          Extracts a key tuple from an entity object.
 void objectToKey(E object, TupleOutput output)
          Extracts a key tuple from an entity object.
 
Methods inherited from class com.sleepycat.bind.tuple.TupleTupleBinding
entryToObject, objectToData, objectToKey
 
Methods inherited from class com.sleepycat.bind.tuple.TupleBase
entryToInput, getTupleBufferSize, getTupleOutput, inputToEntry, newOutput, newOutput, outputToEntry, setTupleBufferSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleTupleMarshalledBinding

public TupleTupleMarshalledBinding(Class<E> cls)
Creates a tuple-tuple marshalled binding object.

The given class is used to instantiate entity objects using Class.forName(java.lang.String), and therefore must be a public class and have a public no-arguments constructor. It must also implement the MarshalledTupleEntry and MarshalledTupleKeyEntity interfaces.

Parameters:
cls - is the class of the entity objects.
Method Detail

entryToObject

public E entryToObject(TupleInput keyInput,
                       TupleInput dataInput)
Description copied from class: TupleTupleBinding
Constructs an entity object from TupleInput key and data entries.

Specified by:
entryToObject in class TupleTupleBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
Parameters:
keyInput - is the TupleInput key entry object.
dataInput - is the TupleInput data entry object.
Returns:
the entity object constructed from the key and data.

objectToKey

public void objectToKey(E object,
                        TupleOutput output)
Description copied from class: TupleTupleBinding
Extracts a key tuple from an entity object.

Specified by:
objectToKey in class TupleTupleBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
Parameters:
object - is the entity object.
output - is the TupleOutput to which the key should be written.

objectToData

public void objectToData(E object,
                         TupleOutput output)
Description copied from class: TupleTupleBinding
Extracts a key tuple from an entity object.

Specified by:
objectToData in class TupleTupleBinding<E extends MarshalledTupleEntry & MarshalledTupleKeyEntity>
Parameters:
object - is the entity object.
output - is the TupleOutput to which the data should be written.

Berkeley DB
version 4.8.30

Copyright (c) 1996-2009 Oracle. All rights reserved.