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

LineHitsSource
1 package net.sf.tourviewer.lib.ciclo;
2  
3  
4 public class DataBlock {
5     
6     private int altitudeDelta;
7     private int pulseDelta;
8     private int distanceDelta;
9  
10125052    public DataBlock(int value) {
11         // high -> low
12         
13         // pulse (4)
14125052        if ((value & 0x8000) != 0)
15896            pulseDelta = (((value & 0x7000) >> 12) - 8) * 2;
16         else
17124156            pulseDelta = ((value & 0x7000) >> 12) * 2;
18         
19         // altitude (6)
20125052        if ((value & 0x0800) != 0) {
2135914            altitudeDelta = -32 + ((value & 0x07C0) >> 6);
2235914            if (altitudeDelta < -16)
23310                altitudeDelta = -16 + ((altitudeDelta + 16) * 7);
24         } else {
2589138            altitudeDelta = (value & 0x07C0) >> 6;
2689138            if (altitudeDelta > 16)
2772                altitudeDelta = 16 + ((altitudeDelta - 16) * 7);
28         }
29  
30         // distance (6)
31125052        distanceDelta = value & 0x003F;
32125052    }
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.