| java.lang.Object com.sleepycat.bind.tuple.TupleBase com.sleepycat.bind.tuple.TupleBinding
All known Subclasses: com.sleepycat.bind.tuple.ShortBinding, com.sleepycat.bind.tuple.StringBinding, com.sleepycat.bind.tuple.LongBinding, com.sleepycat.bind.tuple.FloatBinding, com.sleepycat.bind.tuple.TupleMarshalledBinding, com.sleepycat.bind.tuple.IntegerBinding, com.sleepycat.bind.tuple.BigIntegerBinding, je.gettingStarted.InventoryBinding, com.sleepycat.bind.tuple.BooleanBinding, com.sleepycat.bind.tuple.ByteBinding, com.sleepycat.bind.tuple.SortedFloatBinding, com.sleepycat.bind.tuple.SortedDoubleBinding, com.sleepycat.bind.tuple.CharacterBinding, com.sleepycat.bind.tuple.DoubleBinding,
TupleBinding | abstract public class TupleBinding extends TupleBase implements EntryBinding(Code) | | 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)
TupleBinding.getPrimitiveBinding may be used to return a builtin
tuple binding. A custom tuple binding for these types is not needed.
Note:
TupleBinding.getPrimitiveBinding returns bindings that do not
sort negative floating point numbers correctly by default. See
SortedFloatBinding and
SortedDoubleBinding for details.
When a tuple binding is used as a key binding, it produces key values
with a reasonable default sort order. For more information on the default
sort order, see
com.sleepycat.bind.tuple.TupleOutput .
author: Mark Hayes |
Constructor Summary | |
public | TupleBinding() Creates a tuple binding. |
TupleBinding | public TupleBinding()(Code) | | Creates a tuple binding.
|
entryToObject | abstract public Object entryToObject(TupleInput input)(Code) | | Constructs a key or data object from a
TupleInput entry.
Parameters: input - is the tuple key or data entry. the key or data object constructed from the entry. |
getPrimitiveBinding | public static TupleBinding getPrimitiveBinding(Class cls)(Code) | | Creates a tuple binding for a primitive Java class. The following
Java classes are supported.
String
Character
Boolean
Byte
Short
Integer
Long
Float
Double
Note:
TupleBinding.getPrimitiveBinding returns bindings that do
not sort negative floating point numbers correctly by default. See
SortedFloatBinding and
SortedDoubleBinding for
details.
Parameters: cls - is the primitive Java class. a new binding for the primitive class or null if the clsparameter is not one of the supported classes. |
objectToEntry | abstract public void objectToEntry(Object object, TupleOutput output)(Code) | | Converts a key or data object to a tuple entry.
Parameters: object - is the key or data object. Parameters: output - is the tuple entry to which the key or data should bewritten. |
|
|