KickJava   Java API By Example, From Geeks To Geeks.

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

8
9 package collections.ship.tuple;
10
11 import java.io.Serializable JavaDoc;
12
13 /**
14  * A PartData serves as the value in the key/value pair for a part entity.
15  *
16  * <p> In this sample, PartData is used only as the storage data for the
17  * value, while the Part object is used as the value's object representation.
18  * Because it is used directly as storage data using serial format, it must be
19  * Serializable. </p>
20  *
21  * @author Mark Hayes
22  */

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