01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: MarshalledKey.java,v 1.13.2.2 2008/01/07 15:14:02 cwl Exp $
07: */
08:
09: package collections.ship.marshal;
10:
11: import com.sleepycat.bind.tuple.TupleInput;
12: import com.sleepycat.bind.tuple.TupleOutput;
13:
14: /**
15: * MarshalledKey is implemented by key objects and called by {@link
16: * SampleViews.MarshalledKeyBinding}. In this sample, MarshalledKey is
17: * implemented by {@link PartKey}, {@link SupplierKey}, and {@link
18: * ShipmentKey}. This interface is package-protected rather than public to
19: * hide the marshalling interface from other users of the data objects. Note
20: * that a MarshalledKey must also have a no arguments constructor so
21: * that it can be instantiated by the binding.
22: *
23: * @author Mark Hayes
24: */
25: interface MarshalledKey {
26:
27: /**
28: * Construct the key tuple entry from the key object.
29: */
30: void marshalKey(TupleOutput keyOutput);
31:
32: /**
33: * Construct the key object from the key tuple entry.
34: */
35: void unmarshalKey(TupleInput keyInput);
36: }
|