01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: ShipmentData.java,v 1.12.2.2 2008/01/07 15:14:01 cwl Exp $
07: */
08:
09: package collections.ship.index;
10:
11: import java.io.Serializable;
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 {
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 toString() {
38:
39: return "[ShipmentData: quantity=" + quantity + ']';
40: }
41: }
|