KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > league > util > Team


1 /*
2  * Team.java
3  *
4  * Created on March 16, 2005, 2:13 PM
5  *
6  * To change this template, choose Tools | Options and locate the template under
7  * the Source Creation and Management node. Right-click the template and choose
8  * Open. You can then make changes to the template in the Source Editor.
9  */

10
11 package league.util;
12
13 import java.util.Collection JavaDoc;
14 import java.io.*;
15
16 /**
17  *
18  * @author honza
19  */

20 public class Team extends Object JavaDoc implements java.io.Serializable JavaDoc{
21     private String JavaDoc name=null;
22     private Collection JavaDoc players=null;
23     private Integer JavaDoc id=null;
24     private Integer JavaDoc points=null;
25     private Integer JavaDoc startPoints=null;
26     
27     public Team() {
28     }
29     
30     /** Creates a new instance of Team */
31     public Team(Integer JavaDoc id, String JavaDoc name, Collection JavaDoc players, Integer JavaDoc points, Integer JavaDoc startPoints) {
32         this.name=name;
33         this.players=players;
34         this.id=id;
35         this.points=points;
36         this.startPoints=startPoints;
37     }
38     public String JavaDoc toString() {
39         return name;
40     }
41     public String JavaDoc getName() {
42         return name;
43     }
44     public Integer JavaDoc getPoints() {
45         return points;
46     }
47     public Integer JavaDoc getStartPoints() {
48         return startPoints;
49     }
50     public Collection JavaDoc getPlayers() {
51         return players;
52     }
53     public Integer JavaDoc getId() {
54         return id;
55     }
56     
57     private void readObject(java.io.ObjectInputStream JavaDoc ois) throws IOException, ClassNotFoundException JavaDoc{
58         
59         name=(String JavaDoc)ois.readObject();
60     players = (Collection JavaDoc) ois.readObject();
61         id= (Integer JavaDoc) ois.readObject();
62         points=(Integer JavaDoc) ois.readObject();
63         startPoints=(Integer JavaDoc) ois.readObject();
64     ois.close();
65     }
66     
67     private void writeObject(java.io.ObjectOutputStream JavaDoc oos) throws IOException {
68         
69     oos.writeObject(name);
70     oos.writeObject(players);
71         oos.writeObject(id);
72         oos.writeObject(points);
73         oos.writeObject(startPoints);
74     oos.close();
75     }
76     
77     
78     
79 }
80
Popular Tags