1
2 package hoplugins.teamAnalyzer.vo;
3
4 import hoplugins.commons.vo.MatchRating;
5
6 import java.util.Arrays;
7
8
9 /***
10 * Object that holds the Lineup for a certain formation, real or calculated
11 *
12 * @author <a href=mailto:draghetto@users.sourceforge.net>Massimiliano Amato</a>
13 */
14 public class TeamLineup {
15
16
17 /*** Rating of the team on the field */
18 private MatchRating rating;
19
20 /*** Array of the 11 SpotLineup object representing the single spot */
21 private SpotLineup[] spotLineups = new SpotLineup[11];
22
23 /*** Number of stars */
24 private double stars;
25
26
27
28 /***
29 * Returns the SpotLineup for the spot
30 *
31 * @param spot desired spot
32 *
33 * @return a spot lineup
34 */
35 public final SpotLineup getSpotLineup(int spot) {
36 return spotLineups[spot - 1];
37 }
38
39 /***
40 * DOCUMENT ME!
41 *
42 * @param rating
43 */
44 public void setRating(MatchRating rating) {
45 this.rating = rating;
46 }
47
48 /***
49 * DOCUMENT ME!
50 *
51 * @return
52 */
53 public MatchRating getRating() {
54 return rating;
55 }
56
57 /***
58 * Sets the spot place with the passes SpotLineup
59 *
60 * @param detail SpotLineup object
61 * @param spot spot to be filled with the object
62 */
63 public void setSpotLineup(SpotLineup detail, int spot) {
64 spotLineups[spot - 1] = detail;
65 }
66
67 /***
68 * document me!
69 *
70 * @param d
71 */
72 public void setStars(double d) {
73 stars = d;
74 }
75
76 /***
77 * Document me!
78 *
79 * @return
80 */
81 public double getStars() {
82 return stars;
83 }
84
85 /***
86 * toString methode: creates a String representation of the object
87 *
88 * @return the String representation
89 */
90 public String toString() {
91 StringBuffer buffer = new StringBuffer();
92
93 buffer.append("TeamLineup[");
94
95 if (spotLineups == null) {
96 buffer.append("spotLineups = " + "null");
97 } else {
98 buffer.append("spotLineups = " + Arrays.asList(spotLineups).toString());
99 }
100
101 buffer.append("]");
102
103 return buffer.toString();
104 }
105 }