KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > bind > tuple > TupleInputBinding


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2000,2006 Oracle. All rights reserved.
5  *
6  * $Id: TupleInputBinding.java,v 1.22 2006/10/30 21:14:08 bostic Exp $
7  */

8
9 package com.sleepycat.bind.tuple;
10
11 import com.sleepycat.bind.EntryBinding;
12 import com.sleepycat.je.DatabaseEntry;
13
14 /**
15  * A concrete <code>EntryBinding</code> that uses the <code>TupleInput</code>
16  * object as the key or data object.
17  *
18  * A concrete tuple binding for key or data entries which are {@link
19  * TupleInput} objects. This binding is used when tuples themselves are the
20  * objects, rather than using application defined objects. A {@link TupleInput}
21  * must always be used. To convert a {@link TupleOutput} to a {@link
22  * TupleInput}, use the {@link TupleInput#TupleInput(TupleOutput)} constructor.
23  *
24  * @author Mark Hayes
25  */

26 public class TupleInputBinding implements EntryBinding {
27
28     /**
29      * Creates a tuple input binding.
30      */

31     public TupleInputBinding() {
32     }
33
34     // javadoc is inherited
35
public Object JavaDoc entryToObject(DatabaseEntry entry) {
36
37         return TupleBinding.entryToInput(entry);
38     }
39
40     // javadoc is inherited
41
public void objectToEntry(Object JavaDoc object, DatabaseEntry entry) {
42
43         TupleBinding.inputToEntry((TupleInput) object, entry);
44     }
45 }
46
Popular Tags