Clover Coverage Report - AnCal Coverage Report
Coverage timestamp: gio dic 18 2014 12:18:42 EST
../../../../../img/srcFileCovDistChart8.png 73% of files have more coverage
40   155   25   2,35
16   119   0,62   17
17     1,47  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  DataViewItem       Line # 10 40 25 79,5% 0.79452056
 
No Tests
 
1   
2    package pl.magot.vetch.ancal.dataview;
3   
4   
5    import java.util.Calendar;
6   
7    import pl.magot.vetch.ancal.agenda.AgendaViewType;
8   
9   
 
10    public class DataViewItem
11    {
12    //fields
13    public long lID = -1;
14    public String sSubject = "";
15   
16    private long lStartDate = 0;
17    private int iHour = 0;
18    private int iMinute = 0;
19   
20    public long lRepeatEndOnDate = 0;
21    public long lDueDate = 0;
22   
23    public int iDurationInMinutes = 0;
24    public boolean bAlarm = false;
25    public boolean bDone = false;
26    public boolean bAllDay = false;
27    public long lPriority = -1;
28    public int iRepeatType = 0;
29    public int iRepeatEvery = 1;
30    public AgendaViewType viewMode = AgendaViewType.NONE;
31   
32    private long lRepeatDaysBitMask = 0;
33   
34    //methods
 
35  443 toggle public void Clear()
36    {
37  443 lRepeatDaysBitMask = 0;
38    }
39   
 
40  515 toggle public boolean IsRepeat()
41    {
42  515 return (iRepeatType > 0);
43    }
44   
 
45  381 toggle public boolean UseRepeatEndOnDate()
46    {
47  381 return (lRepeatEndOnDate > 0);
48    }
49   
 
50  31 toggle public boolean UseDueDate()
51    {
52  31 return (lDueDate > 0);
53    }
54   
 
55  105 toggle public void SetStartDate(Calendar calUtilDate, long lStartDate)
56    {
57  105 this.lStartDate = lStartDate;
58  105 calUtilDate.setTimeInMillis(this.lStartDate);
59  105 iHour = calUtilDate.get(Calendar.HOUR_OF_DAY);
60  105 iMinute = calUtilDate.get(Calendar.MINUTE);
61    }
62   
 
63  619 toggle public long GetStartDateAsLong()
64    {
65  619 return lStartDate;
66    }
67   
 
68  151 toggle public int GetStartHour()
69    {
70  151 if (bAllDay)
71  97 return 0;
72  54 return iHour;
73    }
74   
 
75  127 toggle public int GetStartMinute()
76    {
77  127 if (bAllDay)
78  83 return 0;
79  44 return iMinute;
80    }
81   
 
82  9 toggle public int GetDuration()
83    {
84  9 return iDurationInMinutes;
85    }
86   
 
87  6 toggle public long GetPriority()
88    {
89  6 return lPriority;
90    }
91   
 
92  156 toggle public void SetVisibleDay(int iDay)
93    {
94  156 lRepeatDaysBitMask |= 0x01L << iDay;
95    }
96   
 
97  938 toggle public boolean GetVisibleDay(int iDay)
98    {
99  938 long bitMask = 0x01L << iDay;
100  938 return ((lRepeatDaysBitMask & bitMask) != 0);
101    }
102   
 
103  9 toggle public long GetVisibleDays()
104    {
105  9 return lRepeatDaysBitMask;
106    }
107   
108    //if bit 0 set -> time occurs for 0 hour, etc...
 
109  0 toggle public long GetTimeDataAsBitMask(int iDay)
110    {
111  0 if (GetVisibleDay(iDay))
112    {
113  0 int iHour = GetStartHour();
114  0 long bitHour = 0x01L << iHour;
115  0 return bitHour;
116    }
117  0 return 0;
118    }
119   
 
120  23 toggle public int GetOverdueDays()
121    {
122  23 long bitMask = 0x01L;
123  23 for (int iDayOffset = 0; iDayOffset < 7; iDayOffset++)
124    {
125  23 if ((lRepeatDaysBitMask & bitMask) == bitMask)
126  23 return iDayOffset;
127  0 bitMask <<= 1;
128    }
129  0 return 0;
130    }
131   
 
132  23 toggle public int GetTimeKey()
133    {
134  23 return (GetStartHour() * 100) + GetStartMinute();
135    }
136   
 
137  23 toggle public boolean TimeOverdue(int iCurrTimeKey)
138    {
139  23 final int iOverdueDays = GetOverdueDays();
140   
141    //test if time overdue
142  23 if (iOverdueDays == 0)
143    {
144  23 if (iCurrTimeKey >= GetTimeKey())
145  15 return true;
146    }
147   
148    //some days overdue
149  8 if (iOverdueDays > 0)
150  0 return true;
151   
152  8 return false;
153    }
154   
155    }