KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > collections > ship > index > 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.12 2006/10/30 21:13:59 bostic Exp $
7  */

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

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