KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > collections > ship > index > PartData


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: PartData.java,v 1.13 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 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 data for the data
17  * as well as the object binding to the data. Because it is used directly as
18  * storage data using serial format, it must be Serializable. </p>
19  *
20  * @author Mark Hayes
21  */

22 public class PartData implements Serializable JavaDoc {
23
24     private String JavaDoc name;
25     private String JavaDoc color;
26     private Weight weight;
27     private String JavaDoc city;
28
29     public PartData(String JavaDoc name, String JavaDoc color, Weight weight, String JavaDoc city) {
30
31         this.name = name;
32         this.color = color;
33         this.weight = weight;
34         this.city = city;
35     }
36
37     public final String JavaDoc getName() {
38
39         return name;
40     }
41
42     public final String JavaDoc getColor() {
43
44         return color;
45     }
46
47     public final Weight getWeight() {
48
49         return weight;
50     }
51
52     public final String JavaDoc getCity() {
53
54         return city;
55     }
56
57     public String JavaDoc toString() {
58
59         return "[PartData: name=" + name +
60         " color=" + color +
61         " weight=" + weight +
62         " city=" + city + ']';
63     }
64 }
65
Popular Tags