|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sleepycat.bdb.bind.tuple.TupleBinding
public abstract class TupleBinding
An abstract tuple binding for tuple keys or values. This class takes care of
converting the data to/from TupleInput and TupleOutput
objects. Its two abstract methods must be implemented by a concrete
subclass to convert between tuples and key or value objects.
For keys or values which are Java primitive classes (String, Integer,
etc) getPrimitiveBinding(java.lang.Class, com.sleepycat.bdb.bind.tuple.TupleFormat) may be used to return a builtin tuple
binding. A custom tuple binding for these types is not needed.
| Field Summary | |
|---|---|
protected TupleFormat |
format
|
| Constructor Summary | |
|---|---|
TupleBinding(TupleFormat format)
Creates a tuple binding. |
|
| Method Summary | |
|---|---|
java.lang.Object |
dataToObject(DataBuffer data)
Converts a data buffer into an Object. |
abstract java.lang.Object |
dataToObject(TupleInput input)
Constructs a key or value object from TupleInput data. |
DataFormat |
getDataFormat()
Returns the format used for the data of this binding. |
static TupleBinding |
getPrimitiveBinding(java.lang.Class cls,
TupleFormat format)
Creates a tuple binding for a primitive Java class. |
void |
objectToData(java.lang.Object object,
DataBuffer data)
Converts an Object into a data buffer. |
abstract void |
objectToData(java.lang.Object object,
TupleOutput output)
Converts a key or value object to a tuple data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TupleFormat format
| Constructor Detail |
|---|
public TupleBinding(TupleFormat format)
format - is the format of the new binding.| Method Detail |
|---|
public java.lang.Object dataToObject(DataBuffer data)
throws java.io.IOException
DataBinding
dataToObject in interface DataBindingdata - is the source data buffer.
java.io.IOException
public void objectToData(java.lang.Object object,
DataBuffer data)
throws java.io.IOException
DataBinding
objectToData in interface DataBindingobject - is the source Object.data - is the destination data buffer.
java.io.IOExceptionpublic DataFormat getDataFormat()
DataBinding
getDataFormat in interface DataBinding
public abstract java.lang.Object dataToObject(TupleInput input)
throws java.io.IOException
TupleInput data.
input - is the tuple key or value data.
java.io.IOException
public abstract void objectToData(java.lang.Object object,
TupleOutput output)
throws java.io.IOException
object - is the key or value object.output - is the tuple data to which the key or value should be
written.
java.io.IOException
public static TupleBinding getPrimitiveBinding(java.lang.Class cls,
TupleFormat format)
StringInteger
cls - is the primitive Java class.format - is the tuple format for the new binding.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||