KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > collections > ship > entity > Shipment


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

8
9 package collections.ship.entity;
10
11 /**
12  * A Shipment represents the combined key/data pair for a shipment entity.
13  *
14  * <p> In this sample, Shipment is created from the stored key/data entry
15  * using a SerialSerialBinding. See {@link SampleViews.ShipmentBinding} for
16  * details. Since this class is not used directly for data storage, it does
17  * not need to be Serializable. </p>
18  *
19  * @author Mark Hayes
20  */

21 public class Shipment {
22
23     private String JavaDoc partNumber;
24     private String JavaDoc supplierNumber;
25     private int quantity;
26
27     public Shipment(String JavaDoc partNumber, String JavaDoc supplierNumber, int quantity) {
28
29         this.partNumber = partNumber;
30         this.supplierNumber = supplierNumber;
31         this.quantity = quantity;
32     }
33
34     public final String JavaDoc getPartNumber() {
35
36         return partNumber;
37     }
38
39     public final String JavaDoc getSupplierNumber() {
40
41         return supplierNumber;
42     }
43
44     public final int getQuantity() {
45
46         return quantity;
47     }
48
49     public String JavaDoc toString() {
50
51         return "[Shipment: part=" + partNumber +
52                 " supplier=" + supplierNumber +
53                 " quantity=" + quantity + ']';
54     }
55 }
56
Popular Tags