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

com::sleepycat::bind::tuple::ShortBinding Class Reference

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

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 short entryToShort (DatabaseEntry entry)
static void shortToEntry (short val, DatabaseEntry entry)

Protected Member Functions

TupleOutput getTupleOutput (Object object)

Detailed Description

A concrete TupleBinding for a Short primitive wrapper or a short 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 ShortBinding.java.


Member Function Documentation

Object com::sleepycat::bind::tuple::ShortBinding::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 ShortBinding.java.

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

static short com::sleepycat::bind::tuple::ShortBinding::entryToShort DatabaseEntry  entry  )  [inline, static]
 

Converts an entry buffer into a simple short value.

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

Definition at line 58 of file ShortBinding.java.

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

TupleOutput com::sleepycat::bind::tuple::ShortBinding::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 ShortBinding.java.

void com::sleepycat::bind::tuple::ShortBinding::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 ShortBinding.java.

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

static void com::sleepycat::bind::tuple::ShortBinding::shortToEntry short  val,
DatabaseEntry  entry
[inline, static]
 

Converts a simple short value into an entry buffer.

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

Definition at line 70 of file ShortBinding.java.

References 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