Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

ShipmentKey.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: ShipmentKey.java,v 12.2 2005/06/16 20:22:41 bostic Exp $
00008  */
00009 
00010 package collections.ship.marshal;
00011 
00012 import com.sleepycat.bind.tuple.TupleInput;
00013 import com.sleepycat.bind.tuple.TupleOutput;
00014 
00024 public class ShipmentKey implements MarshalledKey {
00025 
00026     private String partNumber;
00027     private String supplierNumber;
00028 
00029     public ShipmentKey(String partNumber, String supplierNumber) {
00030 
00031         this.partNumber = partNumber;
00032         this.supplierNumber = supplierNumber;
00033     }
00034 
00035     public final String getPartNumber() {
00036 
00037         return partNumber;
00038     }
00039 
00040     public final String getSupplierNumber() {
00041 
00042         return supplierNumber;
00043     }
00044 
00045     public String toString() {
00046 
00047         return "[ShipmentKey: supplier=" + supplierNumber +
00048                 " part=" + partNumber + ']';
00049     }
00050 
00051     // --- MarshalledKey implementation ---
00052 
00053     ShipmentKey() {
00054 
00055         // A no-argument constructor is necessary only to allow the binding to
00056         // instantiate objects of this class.
00057     }
00058 
00059     public void unmarshalKey(TupleInput keyInput) {
00060 
00061         this.partNumber = keyInput.readString();
00062         this.supplierNumber = keyInput.readString();
00063     }
00064 
00065     public void marshalKey(TupleOutput keyOutput) {
00066 
00067         keyOutput.writeString(this.partNumber);
00068         keyOutput.writeString(this.supplierNumber);
00069     }
00070 }

Generated on Sun Dec 25 12:14:27 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2