01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: PartData.java,v 1.13.2.2 2008/01/07 15:14:00 cwl Exp $
07: */
08:
09: package collections.ship.basic;
10:
11: import java.io.Serializable;
12:
13: /**
14: * A PartData serves as the data in the key/data pair for a part entity.
15: *
16: * <p> In this sample, PartData is used both as the storage entry for the
17: * data as well as the object binding to the data. Because it is used
18: * directly as storage data using serial format, it must be Serializable. </p>
19: *
20: * @author Mark Hayes
21: */
22: public class PartData implements Serializable {
23:
24: private String name;
25: private String color;
26: private Weight weight;
27: private String city;
28:
29: public PartData(String name, String color, Weight weight,
30: String city) {
31:
32: this .name = name;
33: this .color = color;
34: this .weight = weight;
35: this .city = city;
36: }
37:
38: public final String getName() {
39:
40: return name;
41: }
42:
43: public final String getColor() {
44:
45: return color;
46: }
47:
48: public final Weight getWeight() {
49:
50: return weight;
51: }
52:
53: public final String getCity() {
54:
55: return city;
56: }
57:
58: public String toString() {
59:
60: return "[PartData: name=" + name + " color=" + color
61: + " weight=" + weight + " city=" + city + ']';
62: }
63: }
|