KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > collections > ship > tuple > Part


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: Part.java,v 1.11 2006/10/30 21:14:02 bostic Exp $
7  */

8
9 package collections.ship.tuple;
10
11 /**
12  * A Part represents the combined key/data pair for a part entity.
13  *
14  * <p> In this sample, Part is created from the stored key/data entry using a
15  * SerialSerialBinding. See {@link SampleViews.PartBinding} for details.
16  * Since this class is not directly used for data storage, it does not need to
17  * be Serializable. </p>
18  *
19  * @author Mark Hayes
20  */

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