KickJava   Java API By Example, From Geeks To Geeks.

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


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

8
9 package collections.ship.entity;
10
11 import java.io.Serializable JavaDoc;
12
13 /**
14  * A ShipmentData serves as the value in the key/value pair for a shipment
15  * entity.
16  *
17  * <p> In this sample, ShipmentData is used only as the storage data for the
18  * value, while the Shipment object is used as the value's object
19  * representation. Because it is used directly as storage data using
20  * serial format, it must be Serializable. </p>
21  *
22  * @author Mark Hayes
23  */

24 public class ShipmentData implements Serializable JavaDoc {
25
26     private int quantity;
27
28     public ShipmentData(int quantity) {
29
30         this.quantity = quantity;
31     }
32
33     public final int getQuantity() {
34
35         return quantity;
36     }
37
38     public String JavaDoc toString() {
39
40         return "[ShipmentData: quantity=" + quantity + ']';
41     }
42 }
43
Popular Tags