01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2000,2008 Oracle. All rights reserved.
05: *
06: * $Id: TupleInputBinding.java,v 1.22.2.2 2008/01/07 15:14:06 cwl Exp $
07: */
08:
09: 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 entryToObject(DatabaseEntry entry) {
36:
37: return TupleBinding.entryToInput(entry);
38: }
39:
40: // javadoc is inherited
41: public void objectToEntry(Object object, DatabaseEntry entry) {
42:
43: TupleBinding.inputToEntry((TupleInput) object, entry);
44: }
45: }
|