Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
/*
2
 * Copyright 2009-2014 PrimeTek.
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.primefaces.ultima.domain;
17
 
18
import java.io.Serializable;
19
import java.util.ArrayList;
20
import java.util.List;
21
 
22
public class Team implements Serializable {
23
 
24
    private String name;
25
 
26
    private List<Stats> stats;
27
 
28
    public Team() {
29
        stats = new ArrayList<Stats>();
30
    }
31
 
32
    public Team(String name) {
33
        this.name = name;
34
        stats = new ArrayList<Stats>();
35
    }
36
 
37
    public String getName() {
38
        return name;
39
    }
40
 
41
    public void setName(String name) {
42
        this.name = name;
43
    }
44
 
45
    public List<Stats> getStats() {
46
        return stats;
47
    }
48
 
49
    public void setStats(List<Stats> stats) {
50
        this.stats = stats;
51
    }
52
 
53
    public int getAllWins() {
54
        int sum = 0;
55
 
56
        for(Stats s : stats) {
57
            sum += s.getWin();
58
        }
59
 
60
        return sum;
61
    }
62
 
63
    public int getAllLosses() {
64
        int sum = 0;
65
 
66
        for(Stats s : stats) {
67
            sum += s.getLoss();
68
        }
69
 
70
        return sum;
71
    }
72
}