1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2002,2008 Oracle. All rights reserved. 5 * 6 * $Id: Part.java,v 12.7 2008/01/08 20:58:31 bostic Exp $ 7 */ 8 9package 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 */ 21public 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, Weight weight, 30 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 + 67 " name=" + name + 68 " color=" + color + 69 " weight=" + weight + 70 " city=" + city + ']'; 71 } 72} 73