01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: Part.java,v 1.11.2.2 2008/01/07 15:14:00 cwl Exp $
07: */
08:
09: package collections.ship.entity;
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 used directly 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 number;
24: private String name;
25: private String color;
26: private Weight weight;
27: private String city;
28:
29: public Part(String number, String name, String color,
30: Weight weight, String 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 getNumber() {
40:
41: return number;
42: }
43:
44: public final String getName() {
45:
46: return name;
47: }
48:
49: public final String getColor() {
50:
51: return color;
52: }
53:
54: public final Weight getWeight() {
55:
56: return weight;
57: }
58:
59: public final String getCity() {
60:
61: return city;
62: }
63:
64: public String toString() {
65:
66: return "[Part: number=" + number + " name=" + name + " color="
67: + color + " weight=" + weight + " city=" + city + ']';
68: }
69: }
|