Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

Part.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: Part.java,v 12.2 2005/06/16 20:22:29 bostic Exp $
00008  */
00009 
00010 package collections.ship.factory;
00011 
00012 import java.io.Serializable;
00013 
00014 import com.sleepycat.bind.tuple.MarshalledTupleKeyEntity;
00015 import com.sleepycat.bind.tuple.TupleInput;
00016 import com.sleepycat.bind.tuple.TupleOutput;
00017 
00034 public class Part implements Serializable, MarshalledTupleKeyEntity {
00035 
00036     private transient String number;
00037     private String name;
00038     private String color;
00039     private Weight weight;
00040     private String city;
00041 
00042     public Part(String number, String name, String color, Weight weight,
00043                 String city) {
00044 
00045         this.number = number;
00046         this.name = name;
00047         this.color = color;
00048         this.weight = weight;
00049         this.city = city;
00050     }
00051 
00052     public final String getNumber() {
00053 
00054         return number;
00055     }
00056 
00057     public final String getName() {
00058 
00059         return name;
00060     }
00061 
00062     public final String getColor() {
00063 
00064         return color;
00065     }
00066 
00067     public final Weight getWeight() {
00068 
00069         return weight;
00070     }
00071 
00072     public final String getCity() {
00073 
00074         return city;
00075     }
00076 
00077     public String toString() {
00078 
00079         return "[Part: number=" + number +
00080             " name=" + name +
00081             " color=" + color +
00082             " weight=" + weight +
00083             " city=" + city + ']';
00084     }
00085 
00086     // --- MarshalledTupleKeyEntity implementation ---
00087 
00088     public void marshalPrimaryKey(TupleOutput keyOutput) {
00089 
00090         keyOutput.writeString(this.number);
00091     }
00092 
00093     public void unmarshalPrimaryKey(TupleInput keyInput) {
00094 
00095         this.number = keyInput.readString();
00096     }
00097 
00098     public boolean marshalSecondaryKey(String keyName, TupleOutput keyOutput) {
00099 
00100         throw new UnsupportedOperationException(keyName);
00101     }
00102 
00103     public boolean nullifyForeignKey(String keyName) {
00104 
00105         throw new UnsupportedOperationException(keyName);
00106     }
00107 }

Generated on Sun Dec 25 12:14:27 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2