View Javadoc

1   // %3362983910:hoplugins.teamAnalyzer.vo%
2   package hoplugins.teamAnalyzer.vo;
3   
4   import java.util.ArrayList;
5   import java.util.List;
6   
7   
8   /***
9    * TODO Missing Class Documentation
10   *
11   * @author TODO Author Name
12   */
13  public class RosterPlayerData {
14      //~ Instance fields ----------------------------------------------------------------------------
15  
16      private String name;
17      private RosterRoleData[] app = new RosterRoleData[25];
18      private int id;
19  
20      //~ Constructors -------------------------------------------------------------------------------
21  
22      /***
23       * Creates a new PlayerData object.
24       */
25      public RosterPlayerData() {
26          for (int i = 0; i < 25; i++) {
27              app[i] = new RosterRoleData(i);
28          }
29      }
30  
31      //~ Methods ------------------------------------------------------------------------------------
32  
33      /***
34       * TODO Missing Method Documentation
35       *
36       * @param i TODO Missing Method Parameter Documentation
37       */
38      public void setId(int i) {
39          id = i;
40      }
41  
42      /***
43       * TODO Missing Method Documentation
44       *
45       * @return TODO Missing Return Method Documentation
46       */
47      public int getId() {
48          return id;
49      }
50  
51      /***
52       * TODO Missing Method Documentation
53       *
54       * @return TODO Missing Return Method Documentation
55       */
56      public int getMainPosition() {
57          int pos = -1;
58          int val = -1;
59  
60          for (int i = 0; i < 25; i++) {
61              if (app[i].getApp() > val) {
62                  pos = i;
63                  val = app[i].getApp();
64              }
65          }
66  
67          return pos;
68      }
69  
70      /***
71       * TODO Missing Method Documentation
72       *
73       * @return TODO Missing Return Method Documentation
74       */
75      public RosterRoleData getMainRole() {
76          return app[getMainPosition()];
77      }
78  
79      /***
80       * TODO Missing Method Documentation
81       *
82       * @param i TODO Missing Method Parameter Documentation
83       */
84      public void setName(String i) {
85          name = i;
86      }
87  
88      /***
89       * TODO Missing Method Documentation
90       *
91       * @return TODO Missing Return Method Documentation
92       */
93      public String getName() {
94          return name;
95      }
96  
97      /***
98       * TODO Missing Method Documentation
99       *
100      * @return TODO Missing Return Method Documentation
101      */
102     public List getSecondaryRoles() {
103         int main = getMainPosition();
104         List l = new ArrayList();
105 
106         for (int i = 0; i < app.length; i++) {
107             RosterRoleData array_element = app[i];
108 
109             if ((array_element.getApp() > 0) && (array_element.getPos() != main)) {
110                 l.add(array_element);
111             }
112         }
113 
114         return l;
115     }
116 
117     /***
118      * TODO Missing Method Documentation
119      *
120      * @param spot TODO Missing Method Parameter Documentation
121      */
122     public void addMatch(SpotLineup spot) {
123         if (spot.getPosition() > -1) {
124             app[spot.getPosition()].addMatch(spot.getRating());
125         }
126     }
127 }