KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4odoc > f1 > lists > Team


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com */
2
3 package com.db4odoc.f1.lists;
4
5 import java.util.List JavaDoc;
6
7 import com.db4odoc.f1.evaluations.Pilot;
8
9 public class Team {
10     private List JavaDoc pilots;
11     private String JavaDoc name;
12     
13     public Team(){
14         pilots = CollectionFactory.newList();
15     }
16     
17     public void setName(String JavaDoc name){
18         this.name = name;
19     }
20     
21     public String JavaDoc getName(){
22         return name;
23     }
24     
25     public void addPilot(Pilot pilot){
26         pilots.add(pilot);
27     }
28     
29     public Pilot getPilot(int index){
30         return (Pilot)pilots.get(index);
31     }
32     
33     public void removePilot(int index){
34         pilots.remove(index);
35     }
36     
37     public void updatePilot(int index, Pilot newPilot){
38         pilots.set(index, newPilot);
39     }
40 }
41
Popular Tags