View Javadoc

1   // %2218737670:hoplugins.teamAnalyzer.vo%
2   package hoplugins.teamAnalyzer.vo;
3   
4   import hoplugins.Commons;
5   
6   
7   /***
8    * TODO Missing Class Documentation
9    *
10   * @author TODO Author Name
11   */
12  public class RosterRoleData {
13      //~ Instance fields ----------------------------------------------------------------------------
14  
15      private double avg;
16      private double max;
17      private double min;
18      private int app;
19      private int pos;
20  
21      //~ Constructors -------------------------------------------------------------------------------
22  
23      /***
24       * Creates a new RoleData object.
25       *
26       * @param pos TODO Missing Constructuor Parameter Documentation
27       */
28      public RosterRoleData(int pos) {
29          this.pos = pos;
30          this.max = -1;
31          this.min = 10000;
32      }
33  
34      //~ Methods ------------------------------------------------------------------------------------
35  
36      /***
37       * TODO Missing Method Documentation
38       *
39       * @return TODO Missing Return Method Documentation
40       */
41      public int getApp() {
42          return app;
43      }
44  
45      /***
46       * TODO Missing Method Documentation
47       *
48       * @return TODO Missing Return Method Documentation
49       */
50      public double getAvg() {
51          return avg;
52      }
53  
54      /***
55       * TODO Missing Method Documentation
56       *
57       * @return TODO Missing Return Method Documentation
58       */
59      public double getMax() {
60          return max;
61      }
62  
63      /***
64       * TODO Missing Method Documentation
65       *
66       * @return TODO Missing Return Method Documentation
67       */
68      public double getMin() {
69          return min;
70      }
71  
72      /***
73       * TODO Missing Method Documentation
74       *
75       * @return TODO Missing Return Method Documentation
76       */
77      public int getPos() {
78          return pos;
79      }
80  
81      /***
82       * TODO Missing Method Documentation
83       *
84       * @return TODO Missing Return Method Documentation
85       */
86      public String getPositionDesc() {
87          int posCode = Commons.getModel().getHelper().getPosition(pos);
88  
89          return Commons.getModel().getHelper().getNameForPosition((byte) posCode);
90      }
91  
92      /***
93       * TODO Missing Method Documentation
94       *
95       * @param rating TODO Missing Method Parameter Documentation
96       */
97      public void addMatch(double rating) {
98          if (rating > max) {
99              max = rating;
100         }
101 
102         if (rating < min) {
103             min = rating;
104         }
105 
106         avg = ((avg * app) + rating) / (app + 1d);
107         app++;
108     }
109 }