1 10 11 package league.util; 12 13 import java.util.Collection ; 14 import java.io.*; 15 16 20 public class Team extends Object implements java.io.Serializable { 21 private String name=null; 22 private Collection players=null; 23 private Integer id=null; 24 private Integer points=null; 25 private Integer startPoints=null; 26 27 public Team() { 28 } 29 30 31 public Team(Integer id, String name, Collection players, Integer points, Integer 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 toString() { 39 return name; 40 } 41 public String getName() { 42 return name; 43 } 44 public Integer getPoints() { 45 return points; 46 } 47 public Integer getStartPoints() { 48 return startPoints; 49 } 50 public Collection getPlayers() { 51 return players; 52 } 53 public Integer getId() { 54 return id; 55 } 56 57 private void readObject(java.io.ObjectInputStream ois) throws IOException, ClassNotFoundException { 58 59 name=(String )ois.readObject(); 60 players = (Collection ) ois.readObject(); 61 id= (Integer ) ois.readObject(); 62 points=(Integer ) ois.readObject(); 63 startPoints=(Integer ) ois.readObject(); 64 ois.close(); 65 } 66 67 private void writeObject(java.io.ObjectOutputStream 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 |