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:32 bostic Exp $
00008  */
00009 
00010 package collections.ship.factory;
00011 
00012 import com.sleepycat.bind.tuple.MarshalledTupleEntry;
00013 import com.sleepycat.bind.tuple.TupleInput;
00014 import com.sleepycat.bind.tuple.TupleOutput;
00015 
00025 public class ShipmentKey implements MarshalledTupleEntry {
00026 
00027     private String partNumber;
00028     private String supplierNumber;
00029 
00030     public ShipmentKey(String partNumber, String supplierNumber) {
00031 
00032         this.partNumber = partNumber;
00033         this.supplierNumber = supplierNumber;
00034     }
00035 
00036     public final String getPartNumber() {
00037 
00038         return partNumber;
00039     }
00040 
00041     public final String getSupplierNumber() {
00042 
00043         return supplierNumber;
00044     }
00045 
00046     public String toString() {
00047 
00048         return "[ShipmentKey: supplier=" + supplierNumber +
00049                 " part=" + partNumber + ']';
00050     }
00051 
00052     // --- MarshalledTupleEntry implementation ---
00053 
00054     public ShipmentKey() {
00055 
00056         // A no-argument constructor is necessary only to allow the binding to
00057         // instantiate objects of this class.
00058     }
00059 
00060     public void marshalEntry(TupleOutput keyOutput) {
00061 
00062         keyOutput.writeString(this.partNumber);
00063         keyOutput.writeString(this.supplierNumber);
00064     }
00065 
00066     public void unmarshalEntry(TupleInput keyInput) {
00067 
00068         this.partNumber = keyInput.readString();
00069         this.supplierNumber = keyInput.readString();
00070     }
00071 }

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