01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2000,2008 Oracle. All rights reserved.
05: *
06: * $Id: MarshalledTupleEntry.java,v 1.21.2.2 2008/01/07 15:14:06 cwl Exp $
07: */
08:
09: package com.sleepycat.bind.tuple;
10:
11: /**
12: * A marshalling interface implemented by key, data or entity classes that
13: * are represented as tuples.
14: *
15: * <p>Key classes implement this interface to marshal their key entry. Data or
16: * entity classes implement this interface to marshal their data entry.
17: * Implementations of this interface must have a public no arguments
18: * constructor so that they can be instantiated by a binding, prior to calling
19: * the {@link #unmarshalEntry} method.</p>
20: *
21: * <p>Note that implementing this interface is not necessary when the object is
22: * a Java simple type, for example: String, Integer, etc. These types can be
23: * used with built-in bindings returned by {@link
24: * TupleBinding#getPrimitiveBinding}.</p>
25: *
26: * @author Mark Hayes
27: * @see TupleTupleMarshalledBinding
28: */
29: public interface MarshalledTupleEntry {
30:
31: /**
32: * Construct the key or data tuple entry from the key or data object.
33: *
34: * @param dataOutput is the output tuple.
35: */
36: void marshalEntry(TupleOutput dataOutput);
37:
38: /**
39: * Construct the key or data object from the key or data tuple entry.
40: *
41: * @param dataInput is the input tuple.
42: */
43: void unmarshalEntry(TupleInput dataInput);
44: }
|