Coverage details for net.sf.tourviewer.ciclo.DataRecord

LineHitsSource
1 package net.sf.tourviewer.ciclo;
2  
3  
4 public class DataRecord {
5     
6     private int altitudeDelta;
7     private int pulseDelta;
8     private int distanceDelta;
9  
100    public DataRecord(int value) {
11         // high -> low
12         
13         // pulse (4)
140        if ((value & 0x8000) != 0)
150            pulseDelta = (-16 + ((value & 0x7000) >> 12)) * 2;
16         else
170            pulseDelta = ((value & 0x7000) >> 12) * 2;
18  
19         // altitude (6)
200        if ((value & 0x0800) != 0) {
210            altitudeDelta = -32 + ((value & 0x07C0) >> 6);
220            if (altitudeDelta < -16)
230                altitudeDelta = -16 + ((altitudeDelta + 16) * 7);
24         } else {
250            altitudeDelta = (value & 0x07C0) >> 6;
260            if (altitudeDelta > 16)
270                altitudeDelta = 16 + ((altitudeDelta - 16) * 7);
28         }
29  
30         // distance (6)
310        distanceDelta = value & 0x003F;
320    }
33     
34     @Override
35     public String toString()
36     {
370        return String.format("[P%3d,A%5d,D%2d]", pulseDelta, altitudeDelta, distanceDelta);
38     }
39  
40     
41     public int getAltitudeDelta()
42     {
430        return altitudeDelta;
44     }
45  
46     
47     public int getDistanceDelta()
48     {
490        return distanceDelta;
50     }
51  
52     
53     public int getPulseDelta()
54     {
550        return pulseDelta;
56     }
57     
58 }

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.