Berkeley DB
version 4.2.52

com.sleepycat.bdb.bind.tuple
Class TupleTupleMarshalledBinding

java.lang.Object
  |
  +--com.sleepycat.bdb.bind.tuple.TupleTupleBinding
        |
        +--com.sleepycat.bdb.bind.tuple.TupleTupleMarshalledBinding
All Implemented Interfaces:
EntityBinding

public class TupleTupleMarshalledBinding
extends TupleTupleBinding

A concrete entity binding that uses the MarshalledTupleData and the MarshalledTupleKeyEntity interfaces. It calls the methods of the MarshalledTupleData interface to convert between the value data and entity object. It calls the methods of the MarshalledTupleKeyEntity interface to convert between the key data and the entity object. These two interfaces must both be implemented by the entity class


Constructor Summary
TupleTupleMarshalledBinding(TupleFormat keyFormat, TupleFormat valueFormat, Class cls)
          Creates a tuple-tuple marshalled binding object.
 
Method Summary
 Object dataToObject(TupleInput keyInput, TupleInput valueInput)
          Constructs an entity object from TupleInput key and value data objects.
 void objectToKey(Object object, TupleOutput output)
          Extracts a key tuple from an entity object.
 void objectToValue(Object object, TupleOutput output)
          Extracts a key tuple from an entity object.
 
Methods inherited from class com.sleepycat.bdb.bind.tuple.TupleTupleBinding
dataToObject, getKeyFormat, getValueFormat, objectToKey, objectToValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleTupleMarshalledBinding

public TupleTupleMarshalledBinding(TupleFormat keyFormat,
                                   TupleFormat valueFormat,
                                   Class 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 MarshalledTupleData and MarshalledTupleKeyEntity interfaces.

Parameters:
keyFormat - is the stored data key format.
valueFormat - is the stored data value format.
cls - is the class of the entity objects.
Method Detail

dataToObject

public Object dataToObject(TupleInput keyInput,
                           TupleInput valueInput)
                    throws IOException
Description copied from class: TupleTupleBinding
Constructs an entity object from TupleInput key and value data objects.

Specified by:
dataToObject in class TupleTupleBinding
Parameters:
keyInput - is the TupleInput key data object.
valueInput - is the TupleInput value data object.
Returns:
the entity object constructed from the key and value.
IOException

objectToKey

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

Specified by:
objectToKey in class TupleTupleBinding
Parameters:
object - is the entity object.
output - is the TupleOutput to which the key should be written.
IOException

objectToValue

public void objectToValue(Object object,
                          TupleOutput output)
                   throws IOException
Description copied from class: TupleTupleBinding
Extracts a key tuple from an entity object.

Specified by:
objectToValue in class TupleTupleBinding
Parameters:
object - is the entity object.
output - is the TupleOutput to which the value should be written.
IOException

Berkeley DB
version 4.2.52

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.