1 package net.sf.tourviewer.lib;
2
3 import java.util.ArrayList;
4 import java.util.Date;
5 import java.util.List;
6
7 public class TourSet {
8
9 private List<Bike> bikes = new ArrayList<Bike>();
10 private Date dateOfBirth;
11 private Device device;
12 private String personName;
13 private int personWeight;
14 private String team;
15 private int totalAltitudeDown;
16 private int totalAltitudeUp;
17 private long totalDistance;
18 private long totalTravelTime;
19 private List<Tour> tours = new ArrayList<Tour>();
20
21 public TourSet()
22 {
23 }
24
25 public void addBike(Bike bike)
26 {
27 bikes.add(bike);
28 }
29
30 public void addTour(Tour tour)
31 {
32 tours.add(tour);
33 }
34
35 public Bike getBikeByWheelPerimeter(int perimeter)
36 {
37 for (Bike bike : bikes) {
38 if (bike.getWheelPerimeter() == perimeter) {
39 return bike;
40 }
41 }
42 return null;
43 }
44
45 public Bike[] getBikes()
46 {
47 return bikes.toArray(new Bike[0]);
48 }
49
50 public Date getDateOfBirth()
51 {
52 return dateOfBirth;
53 }
54
55 public Device getDevice()
56 {
57 return device;
58 }
59
60 public String getPersonName()
61 {
62 return personName;
63 }
64
65 public int getPersonWeight()
66 {
67 return personWeight;
68 }
69
70 public String getTeam()
71 {
72 return team;
73 }
74
75 public int getTotalAltitudeDown()
76 {
77 return totalAltitudeDown;
78 }
79
80 public int getTotalAltitudeUp()
81 {
82 return totalAltitudeUp;
83 }
84
85 public long getTotalDistance()
86 {
87 return totalDistance;
88 }
89
90 public long getTotalTravelTime()
91 {
92 return totalTravelTime;
93 }
94
95 public Tour[] getTours()
96 {
97 return tours.toArray(new Tour[0]);
98 }
99
100 public void setDateOfBirth(Date dateOfBirth)
101 {
102 this.dateOfBirth = dateOfBirth;
103 }
104
105
106 public void setDevice(Device device)
107 {
108 this.device = device;
109 }
110
111
112 public void setPersonName(String personName)
113 {
114 this.personName = personName;
115 }
116
117
118 public void setPersonWeight(int personWeight)
119 {
120 this.personWeight = personWeight;
121 }
122
123
124 public void setTeam(String team)
125 {
126 this.team = team;
127 }
128
129
130 public void setTotalAltitudeDown(int totalAltitudeDown)
131 {
132 this.totalAltitudeDown = totalAltitudeDown;
133 }
134
135
136 public void setTotalAltitudeUp(int totalAltitudeUp)
137 {
138 this.totalAltitudeUp = totalAltitudeUp;
139 }
140
141
142 public void setTotalDistance(long totalDistance)
143 {
144 this.totalDistance = totalDistance;
145 }
146
147
148 public void setTotalTravelTime(long totalTravelTime)
149 {
150 this.totalTravelTime = totalTravelTime;
151 }
152
153
154 public void setTours(List<Tour> tours)
155 {
156 this.tours = tours;
157 }
158
159
160 @Override
161 public String toString()
162 {
163 return getClass().getName() + String.format("[personName=%s,personWeight=%d,device=%s]",
164 personName, personWeight, device);
165 }
166
167 }