1 16 package org.apache.cocoon.forms.samples.dreamteam; 17 18 import java.util.ArrayList ; 19 import java.util.Collection ; 20 import java.util.Iterator ; 21 22 25 public class Team { 26 27 private Collection team = new ArrayList (); 28 29 public Team() { 30 } 31 32 public Collection getTeam() { 33 return team; 34 } 35 36 public void setTeam(Collection _team) { 37 team = _team; 38 } 39 40 public void addMember(TeamMember member) { 41 team.add(member); 42 } 43 44 public TeamMember getMember(String memberID) { 45 TeamMember member = null; 46 if (team == null) { 47 return null; 48 } 49 for (Iterator iter = team.iterator(); iter.hasNext();) { 50 member = (TeamMember) iter.next(); 51 if (member.getMemberId().equals(memberID)) { 52 return member; 53 } 54 } 55 return null; 56 } 57 } 58 | Popular Tags |