Line | Hits | Source |
---|---|---|
1 | package net.sf.tourviewer; | |
2 | ||
3 | import java.util.ArrayList; | |
4 | import java.util.Iterator; | |
5 | import java.util.List; | |
6 | ||
7 | public class TourSet { | |
8 | ||
9 | private String personName; | |
10 | private int personWeight; | |
11 | private String deviceName; | |
12 | 0 | private List<Tour> tours = new ArrayList<Tour>(); |
13 | 0 | private List<Bike> bikes = new ArrayList<Bike>(); |
14 | ||
15 | 0 | public TourSet() |
16 | { | |
17 | 0 | } |
18 | ||
19 | @Override | |
20 | public String toString() | |
21 | { | |
22 | 0 | return getClass().getName() + String.format("[personName=%s,personWeight=%d,deviceName=%s]", |
23 | 0 | personName, personWeight, deviceName); |
24 | } | |
25 | ||
26 | public Bike[] getBikes() | |
27 | { | |
28 | 0 | return bikes.toArray(new Bike[0]); |
29 | } | |
30 | ||
31 | public Bike getBikeByWheelPerimeter(int perimeter) | |
32 | { | |
33 | 0 | for (Bike bike : bikes) { |
34 | 0 | if (bike.getWheelPerimeter() == perimeter) { |
35 | 0 | return bike; |
36 | } | |
37 | } | |
38 | 0 | return null; |
39 | } | |
40 | ||
41 | public String getDeviceName() | |
42 | { | |
43 | 0 | return deviceName; |
44 | } | |
45 | ||
46 | public String getPersonName() | |
47 | { | |
48 | 0 | return personName; |
49 | } | |
50 | ||
51 | public int getPersonWeight() | |
52 | { | |
53 | 0 | return personWeight; |
54 | } | |
55 | ||
56 | public Tour[] getTours() | |
57 | { | |
58 | 0 | return tours.toArray(new Tour[0]); |
59 | } | |
60 | ||
61 | public void addBike(Bike bike) | |
62 | { | |
63 | 0 | bikes.add(bike); |
64 | 0 | } |
65 | ||
66 | public void addTour(Tour tour) | |
67 | { | |
68 | 0 | tours.add(tour); |
69 | 0 | } |
70 | ||
71 | public void setDeviceName(String deviceName) | |
72 | { | |
73 | 0 | this.deviceName = deviceName; |
74 | 0 | } |
75 | ||
76 | public void setPersonName(String personName) | |
77 | { | |
78 | 0 | this.personName = personName; |
79 | 0 | } |
80 | ||
81 | public void setPersonWeight(int personWeight) | |
82 | { | |
83 | 0 | this.personWeight = personWeight; |
84 | 0 | } |
85 | ||
86 | public void setTours(List<Tour> tours) | |
87 | { | |
88 | 0 | this.tours = tours; |
89 | 0 | } |
90 | ||
91 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |