View Javadoc

1   // %1534136644:hoplugins.teamAnalyzer.vo%
2   package hoplugins.teamAnalyzer.vo;
3   
4   import hoplugins.commons.vo.MatchRating;
5   
6   import java.util.ArrayList;
7   import java.util.List;
8   
9   
10  /***
11   * Match Detail containing data about the players that played in that game
12   *
13   * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
14   */
15  public class MatchDetail {
16      //~ Instance fields ----------------------------------------------------------------------------
17  
18      /*** ArrayList of Player performance for this game */
19      private List playerPerf = new ArrayList();
20  
21      /*** Match to which the details are reffered */
22      private Match match;
23  
24      /*** Rating on the 7 areas of the pitch */
25      private MatchRating rating = new MatchRating();
26  
27      /*** Starting Lineup */
28      private String formation;
29  
30      /*** Total number of stars */
31      private double stars;
32  
33      /*** Tactic used in the game */
34      private int tacticCode;
35  
36      /*** Tactic LEvel achieved in the game */
37      private int tacticLevel;
38  
39      //~ Constructors -------------------------------------------------------------------------------
40  
41      /***
42       * Creates a new MatchDetail object.
43       *
44       * @param aMatch match for which the details are
45       */
46      public MatchDetail(Match aMatch) {
47          match = aMatch;
48      }
49  
50      //~ Methods ------------------------------------------------------------------------------------
51  
52      /***
53       * Document Me!
54       *
55       * @return
56       */
57      public final List getPerformances() {
58          return playerPerf;
59      }
60  
61      /***
62       * Document Me!
63       *
64       * @param i
65       */
66      public void setFormation(String i) {
67          formation = i;
68      }
69  
70      /***
71       * Document Me!
72       *
73       * @return
74       */
75      public String getFormation() {
76          return formation;
77      }
78  
79      /***
80       * DOCUMENT ME!
81       *
82       * @return
83       */
84      public Match getMatchDetail() {
85          return match;
86      }
87  
88      /***
89       * Document Me!
90       *
91       * @param rating
92       */
93      public void setRating(MatchRating rating) {
94          this.rating = rating;
95      }
96  
97      /***
98       * Document Me!
99       *
100      * @return
101      */
102     public MatchRating getRating() {
103         return rating;
104     }
105 
106     /***
107      * Document Me!
108      *
109      * @param i
110      */
111     public void setStars(double i) {
112         stars = i;
113     }
114 
115     /***
116      * Document Me!
117      *
118      * @return
119      */
120     public double getStars() {
121         return stars;
122     }
123 
124     /***
125      * Document Me!
126      *
127      * @param i
128      */
129     public void setTacticCode(int i) {
130         tacticCode = i;
131     }
132 
133     /***
134      * Document Me!
135      *
136      * @return
137      */
138     public int getTacticCode() {
139         return tacticCode;
140     }
141 
142     /***
143      * Document Me!
144      *
145      * @param i
146      */
147     public void setTacticLevel(int i) {
148         tacticLevel = i;
149     }
150 
151     /***
152      * Document Me!
153      *
154      * @return
155      */
156     public int getTacticLevel() {
157         return tacticLevel;
158     }
159 
160     /***
161      * Add a player performance to the List
162      *
163      * @param pp PlayerPerformance of a player in the game
164      */
165     public void addMatchLineupPlayer(PlayerPerformance pp) {
166         playerPerf.add(pp);
167     }
168 
169     /***
170      * toString methode: creates a String representation of the object
171      *
172      * @return the String representation
173      */
174     public String toString() {
175         StringBuffer buffer = new StringBuffer();
176 
177         buffer.append("MatchDetail[");
178         buffer.append("playerPerf = " + playerPerf);
179         buffer.append(", match = " + match);
180         buffer.append(", rating = " + rating);
181         buffer.append("]");
182 
183         return buffer.toString();
184     }
185 }