Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

com::sleepycat::bind::tuple::TupleBinding Class Reference

Inheritance diagram for com::sleepycat::bind::tuple::TupleBinding:

com::sleepycat::bind::tuple::TupleBase com::sleepycat::bind::EntryBinding com::sleepycat::bind::tuple::BooleanBinding com::sleepycat::bind::tuple::ByteBinding com::sleepycat::bind::tuple::CharacterBinding com::sleepycat::bind::tuple::DoubleBinding com::sleepycat::bind::tuple::FloatBinding com::sleepycat::bind::tuple::IntegerBinding com::sleepycat::bind::tuple::LongBinding com::sleepycat::bind::tuple::ShortBinding com::sleepycat::bind::tuple::StringBinding com::sleepycat::bind::tuple::TupleMarshalledBinding

Public Member Functions

 TupleBinding ()
Object entryToObject (DatabaseEntry entry)
void objectToEntry (Object object, DatabaseEntry entry)
abstract Object entryToObject (TupleInput input)
abstract void objectToEntry (Object object, TupleOutput output)

Static Public Member Functions

static TupleBinding getPrimitiveBinding (Class cls)

Detailed Description

An abstract EntryBinding that treats a key or data entry as a tuple; it includes predefined bindings for Java primitive types.

This class takes care of converting the entries to/from TupleInput and TupleOutput objects. Its two abstract methods must be implemented by a concrete subclass to convert between tuples and key or data objects.

For key or data entries which are Java primitive classes (String, Integer, etc) getPrimitiveBinding may be used to return a builtin tuple binding. A custom tuple binding for these types is not needed.

Author:
Mark Hayes

Definition at line 37 of file TupleBinding.java.


Constructor & Destructor Documentation

com::sleepycat::bind::tuple::TupleBinding::TupleBinding  )  [inline]
 

Creates a tuple binding.

Definition at line 61 of file TupleBinding.java.


Member Function Documentation

abstract Object com::sleepycat::bind::tuple::TupleBinding::entryToObject TupleInput  input  )  [pure virtual]
 

Constructs a key or data object from a TupleInput entry.

Parameters:
input is the tuple key or data entry.
Returns:
the key or data object constructed from the entry.

Implemented in com::sleepycat::bind::tuple::BooleanBinding, com::sleepycat::bind::tuple::ByteBinding, com::sleepycat::bind::tuple::CharacterBinding, com::sleepycat::bind::tuple::DoubleBinding, com::sleepycat::bind::tuple::FloatBinding, com::sleepycat::bind::tuple::IntegerBinding, com::sleepycat::bind::tuple::LongBinding, com::sleepycat::bind::tuple::ShortBinding, com::sleepycat::bind::tuple::StringBinding, and com::sleepycat::bind::tuple::TupleMarshalledBinding.

Object com::sleepycat::bind::tuple::TupleBinding::entryToObject DatabaseEntry  entry  )  [inline]
 

Converts a entry buffer into an Object.

Parameters:
entry is the source entry buffer.
Returns:
the resulting Object.

Implements com::sleepycat::bind::EntryBinding.

Definition at line 65 of file TupleBinding.java.

References com::sleepycat::bind::tuple::TupleBase::entryToInput().

static TupleBinding com::sleepycat::bind::tuple::TupleBinding::getPrimitiveBinding Class  cls  )  [inline, static]
 

Creates a tuple binding for a primitive Java class. The following Java classes are supported.

  • String
  • Character
  • Boolean
  • Byte
  • Short
  • Integer
  • Long
  • Float
  • Double

Parameters:
cls is the primitive Java class.
Returns:
a new binding for the primitive class or null if the cls parameter is not one of the supported classes.

Definition at line 117 of file TupleBinding.java.

abstract void com::sleepycat::bind::tuple::TupleBinding::objectToEntry Object  object,
TupleOutput  output
[pure virtual]
 

Converts a key or data object to a tuple entry.

Parameters:
object is the key or data object.
output is the tuple entry to which the key or data should be written.

Implemented in com::sleepycat::bind::tuple::BooleanBinding, com::sleepycat::bind::tuple::ByteBinding, com::sleepycat::bind::tuple::CharacterBinding, com::sleepycat::bind::tuple::DoubleBinding, com::sleepycat::bind::tuple::FloatBinding, com::sleepycat::bind::tuple::IntegerBinding, com::sleepycat::bind::tuple::LongBinding, com::sleepycat::bind::tuple::ShortBinding, com::sleepycat::bind::tuple::StringBinding, and com::sleepycat::bind::tuple::TupleMarshalledBinding.

void com::sleepycat::bind::tuple::TupleBinding::objectToEntry Object  object,
DatabaseEntry  entry
[inline]
 

Converts an Object into a entry buffer.

Parameters:
object is the source Object.
entry is the destination entry buffer.

Implements com::sleepycat::bind::EntryBinding.

Definition at line 71 of file TupleBinding.java.

References com::sleepycat::bind::tuple::TupleBase::getTupleOutput(), and com::sleepycat::bind::tuple::TupleBase::outputToEntry().


The documentation for this class was generated from the following file:
Generated on Sun Dec 25 12:14:59 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2