Coverage details for net.sf.tourviewer.lib.ciclo.AABlock

LineHitsSource
1 package net.sf.tourviewer.lib.ciclo;
2  
3  
4  
5 public class AABlock extends AbstractBlock {
6  
7     enum TourType { BIKE2, BIKE1, JOGGING, SKI, BIKE, SKI_BIKE, UNKNOWN };
8     
9     private TourType tourType;
10     private int ddOffset;
11     private int timeHour;
12     private int timeMinute;
13     private int timeMonth;
14     private int timeDay;
15     private int totalDistance;
16     private int mswDistance;
17     private int initialAltitude;
18     private int initialPulse;
19     
20     public AABlock(int[] data) {
21566        super(data);
22         
23566        switch (getHexH(0)) {
24             case 0x2E:
2522                this.tourType = TourType.BIKE1;
2622                break;
27             case 0x3E:
28400                this.tourType = TourType.BIKE2;
29400                break;
30             case 0x81:
3116                this.tourType = TourType.JOGGING;
3216                break;
33             case 0x91:
340                this.tourType = TourType.SKI;
350                break;
36             case 0xA1:
3748                this.tourType = TourType.BIKE;
3848                break;
39             case 0xB1:
4080                this.tourType = TourType.SKI_BIKE;
4180                break;
42             default:
430                this.tourType = TourType.UNKNOWN;
44         }
45         
46566        this.ddOffset = getHex(1);
47566        this.timeHour = getDecH(2);
48566        this.timeMinute = getDecL(2);
49566        this.timeMonth = getDecH(3);
50566        this.timeDay = getDecL(3);
51566        this.totalDistance = getHex(4);
52566        this.mswDistance = getHex(5);
53566        this.initialAltitude = getHex(6);
54566        this.initialPulse = getHex(7);
55566    }
56     
57     @Override
58     public String toString()
59     {
600        StringBuffer sb = new StringBuffer();
610        sb.append(getDataString());
620        sb.append(String.format(" [(AA) Type=%s,DDOffset=%d,Time=%02d-%02d %02d:%02d,TotalDist=%d,MSWDist=%d,InitialAlt=%d,InitalPulse=%d]",
63                 tourType, ddOffset, timeMonth, timeDay, timeHour, timeMinute, totalDistance, mswDistance, initialAltitude, initialPulse));
640        return sb.toString();
65     }
66  
67     
68     public int getDdOffset()
69     {
700        return ddOffset;
71     }
72  
73     
74     public int getInitialAltitude()
75     {
760        return initialAltitude;
77     }
78  
79     
80     public int getInitialPulse()
81     {
820        return initialPulse;
83     }
84  
85     
86     public int getMswDistance()
87     {
880        return mswDistance;
89     }
90  
91     
92     public int getTimeDay()
93     {
940        return timeDay;
95     }
96  
97     
98     public int getTimeHour()
99     {
1000        return timeHour;
101     }
102  
103     
104     public int getTimeMinute()
105     {
1060        return timeMinute;
107     }
108  
109     
110     public int getTimeMonth()
111     {
1120        return timeMonth;
113     }
114  
115     
116     public int getTotalDistance()
117     {
1180        return totalDistance;
119     }
120  
121     
122     public TourType getTourType()
123     {
1240        return tourType;
125     }
126     
127 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.