1/*-
2 * See the file LICENSE for redistribution information.
3 *
4 * Copyright (c) 2002,2008 Oracle.  All rights reserved.
5 *
6 * $Id: PartData.java,v 12.7 2008/01/08 20:58:28 bostic Exp $
7 */
8
9package collections.ship.basic;
10
11import 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 */
22public 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, String city) {
30
31        this.name = name;
32        this.color = color;
33        this.weight = weight;
34        this.city = city;
35    }
36
37    public final String getName() {
38
39        return name;
40    }
41
42    public final String getColor() {
43
44        return color;
45    }
46
47    public final Weight getWeight() {
48
49        return weight;
50    }
51
52    public final String getCity() {
53
54        return city;
55    }
56
57    public String toString() {
58
59        return "[PartData: name=" + name +
60	    " color=" + color +
61	    " weight=" + weight +
62	    " city=" + city + ']';
63    }
64}
65