com.sleepycat.bind.tuple

Class SortedFloatBinding

public class SortedFloatBinding extends TupleBinding

A concrete TupleBinding for a Float primitive wrapper or a float primitive.

This class produces byte array values that by default (without a custom comparator) sort correctly, including sorting of negative values. Therefore, this class should normally be used instead of FloatBinding which does not by default support sorting of negative values. Please note that:

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

Method Detail

entryToFloat

public static float entryToFloat(DatabaseEntry entry)
Converts an entry buffer into a simple float value.

Parameters: entry is the source entry buffer.

Returns: the resulting value.

entryToObject

public Object entryToObject(TupleInput input)

floatToEntry

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

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

getTupleOutput

protected TupleOutput getTupleOutput(Object object)

objectToEntry

public void objectToEntry(Object object, TupleOutput output)