KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > forms > samples > dreamteam > Team


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.forms.samples.dreamteam;
17
18 import java.util.ArrayList JavaDoc;
19 import java.util.Collection JavaDoc;
20 import java.util.Iterator JavaDoc;
21
22 /**
23  * Team
24  */

25 public class Team {
26
27     private Collection JavaDoc team = new ArrayList JavaDoc();
28
29     public Team() {
30     }
31
32     public Collection JavaDoc getTeam() {
33         return team;
34     }
35
36     public void setTeam(Collection JavaDoc _team) {
37         team = _team;
38     }
39
40     public void addMember(TeamMember member) {
41         team.add(member);
42     }
43
44     public TeamMember getMember(String JavaDoc memberID) {
45         TeamMember member = null;
46         if (team == null) {
47             return null;
48         }
49         for (Iterator JavaDoc 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