KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sample > CustomerRecordImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package sample;
25
26 import javax.resource.cci.*;
27 import java.io.Serializable JavaDoc;
28 import java.io.IOException JavaDoc;
29 import java.io.InputStream JavaDoc;
30 import java.io.OutputStream JavaDoc;
31
32
33 public class CustomerRecordImpl extends RecordImpl
34              implements CustomerRecord, Serializable JavaDoc, Streamable {
35   
36   private String JavaDoc custName;
37   private String JavaDoc custAddress;
38   private String JavaDoc custId;
39   
40   public
41   CustomerRecordImpl() {
42   }
43
44   // Set the name of Customer
45
public void setName(String JavaDoc name) {
46     this.custName = name;
47   }
48
49   // Set the Id of Customer
50
public void setId(String JavaDoc custId) {
51     this.custId = custId;
52   }
53
54   // Set the address of Customer
55
public void setAddress(String JavaDoc address) {
56     this.custAddress = address;
57   }
58
59   // get the name of Customer
60
public String JavaDoc getName() {
61     return custName;
62   }
63
64   // get the Id of Customer
65
public String JavaDoc getId() {
66     return custId;
67   }
68
69   // Set the name of Customer
70
public String JavaDoc getAddress() {
71     return custAddress;
72   }
73
74   // Read data from an InputStream and initialize fields
75
public
76   void read(InputStream JavaDoc istream) throws IOException JavaDoc {
77     super.read(istream);
78     //....
79
}
80   
81
82   // Write fields of a Streamable object to an OutputStream
83
public
84   void write(OutputStream JavaDoc ostream) throws IOException JavaDoc {
85     super.write(ostream);
86     //...
87
}
88 }
89
Popular Tags