KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > collections > ship > marshal > MarshalledEntity


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

8
9 package collections.ship.marshal;
10
11 import com.sleepycat.bind.tuple.TupleInput;
12 import com.sleepycat.bind.tuple.TupleOutput;
13
14 /**
15  * MarshalledEntity is implemented by entity (combined key/data) objects and
16  * called by {@link SampleViews.MarshalledEntityBinding}. In this sample,
17  * MarshalledEntity is implemented by {@link Part}, {@link Supplier}, and
18  * {@link Shipment}. This interface is package-protected rather than public
19  * to hide the marshalling interface from other users of the data objects.
20  * Note that a MarshalledEntity 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 MarshalledEntity {
26
27     /**
28      * Extracts the entity's primary key and writes it to the key output.
29      */

30     void marshalPrimaryKey(TupleOutput keyOutput);
31
32     /**
33      * Completes construction of the entity by setting its primary key from the
34      * stored primary key.
35      */

36     void unmarshalPrimaryKey(TupleInput keyInput);
37
38     /**
39      * Extracts the entity's index key and writes it to the key output.
40      */

41     boolean marshalSecondaryKey(String JavaDoc keyName, TupleOutput keyOutput);
42 }
43
Popular Tags