1 2 3 package com.db4odoc.f1.lists; 4 5 import java.util.List ; 6 7 import com.db4odoc.f1.evaluations.Pilot; 8 9 public class Team { 10 private List pilots; 11 private String name; 12 13 public Team(){ 14 pilots = CollectionFactory.newList(); 15 } 16 17 public void setName(String name){ 18 this.name = name; 19 } 20 21 public String 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 |