com.sleepycat.bind.tuple

Class DoubleBinding

public class DoubleBinding extends TupleBinding

A concrete TupleBinding for a Double primitive wrapper or a double primitive.

Note: This class produces byte array values that by default (without a custom comparator) do not sort correctly for negative values. Only non-negative values are sorted correctly by default. To sort all values correctly by default, use SortedDoubleBinding.

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 method.
Method Summary
static voiddoubleToEntry(double val, DatabaseEntry entry)
Converts a simple double value into an entry buffer.
static doubleentryToDouble(DatabaseEntry entry)
Converts an entry buffer into a simple double value.
ObjectentryToObject(TupleInput input)
protected TupleOutputgetTupleOutput(Object object)
voidobjectToEntry(Object object, TupleOutput output)

Method Detail

doubleToEntry

public static void doubleToEntry(double val, DatabaseEntry entry)
Converts a simple double value into an entry buffer.

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

entryToDouble

public static double entryToDouble(DatabaseEntry entry)
Converts an entry buffer into a simple double value.

Parameters: entry is the source entry buffer.

Returns: the resulting value.

entryToObject

public Object entryToObject(TupleInput input)

getTupleOutput

protected TupleOutput getTupleOutput(Object object)

objectToEntry

public void objectToEntry(Object object, TupleOutput output)