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

com::sleepycat::bind::tuple::LongBinding Class Reference

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

com::sleepycat::bind::tuple::TupleBinding com::sleepycat::bind::tuple::TupleBase com::sleepycat::bind::EntryBinding

Public Member Functions

Object entryToObject (TupleInput input)
void objectToEntry (Object object, TupleOutput output)

Static Public Member Functions

static long entryToLong (DatabaseEntry entry)
static void longToEntry (long val, DatabaseEntry entry)

Protected Member Functions

TupleOutput getTupleOutput (Object object)

Detailed Description

A concrete TupleBinding for a Long primitive wrapper or a long primitive.

There are two ways to use this class:

  1. When using the com.sleepycat.db package directly, the static methods in this class can be used to convert between primitive values and DatabaseEntry objects.
  2. When using the com.sleepycat.collections package, an instance of this class can be used with any stored collection. The easiest way to obtain a binding instance is with the TupleBinding#getPrimitiveBinding method.

Definition at line 29 of file LongBinding.java.


Member Function Documentation

static long com::sleepycat::bind::tuple::LongBinding::entryToLong DatabaseEntry  entry  )  [inline, static]
 

Converts an entry buffer into a simple long value.

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

Definition at line 58 of file LongBinding.java.

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

Object com::sleepycat::bind::tuple::LongBinding::entryToObject TupleInput  input  )  [inline, 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.

Implements com::sleepycat::bind::tuple::TupleBinding.

Definition at line 34 of file LongBinding.java.

References com::sleepycat::bind::tuple::TupleInput::readLong().

TupleOutput com::sleepycat::bind::tuple::LongBinding::getTupleOutput Object  object  )  [inline, protected]
 

Returns an empty TupleOutput instance that will be used by the tuple binding or key creator.

The default implementation of this method creates a new TupleOutput with an initial buffer size that can be changed using the setTupleBufferSize method.

This method may be overridden to return a TupleOutput instance. For example, an instance per thread could be created and returned by this method. If a TupleOutput instance is reused, be sure to call its com.sleepycat.util.FastOutputStream#reset method before each use.

Parameters:
object is the object to be written to the tuple output, and may be used by subclasses to determine the size of the output buffer.
Returns:
an empty TupleOutput instance.
See also:
setTupleBufferSize

Reimplemented from com::sleepycat::bind::tuple::TupleBase.

Definition at line 46 of file LongBinding.java.

static void com::sleepycat::bind::tuple::LongBinding::longToEntry long  val,
DatabaseEntry  entry
[inline, static]
 

Converts a simple long value into an entry buffer.

Parameters:
val is the source value.
entry is the destination entry buffer.

Definition at line 70 of file LongBinding.java.

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

void com::sleepycat::bind::tuple::LongBinding::objectToEntry Object  object,
TupleOutput  output
[inline, 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.

Implements com::sleepycat::bind::tuple::TupleBinding.

Definition at line 40 of file LongBinding.java.

References com::sleepycat::bind::tuple::TupleOutput::writeLong().


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