KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sample > EmployeeRecordImpl


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 /** EmployeeRecordImpl.java
25  */

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