KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > collections > ship > basic > ShipmentKey


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

8
9 package collections.ship.basic;
10
11 import java.io.Serializable JavaDoc;
12
13 /**
14  * A ShipmentKey serves as the key in the key/data pair for a shipment entity.
15  *
16  * <p> In this sample, ShipmentKey is used both as the storage entry for the
17  * key as well as the object binding to the key. Because it is used directly
18  * as storage data using serial format, it must be Serializable. </p>
19  *
20  * @author Mark Hayes
21  */

22 public class ShipmentKey implements Serializable JavaDoc {
23
24     private String JavaDoc partNumber;
25     private String JavaDoc supplierNumber;
26
27     public ShipmentKey(String JavaDoc partNumber, String JavaDoc supplierNumber) {
28
29         this.partNumber = partNumber;
30         this.supplierNumber = supplierNumber;
31     }
32
33     public final String JavaDoc getPartNumber() {
34
35         return partNumber;
36     }
37
38     public final String JavaDoc getSupplierNumber() {
39
40         return supplierNumber;
41     }
42
43     public String JavaDoc toString() {
44
45         return "[ShipmentKey: supplier=" + supplierNumber +
46         " part=" + partNumber + ']';
47     }
48 }
49
Popular Tags