Last change
on this file since 250 was 250, checked in by Nicholas Riley, 18 years ago |
Refactor editing, coalese Alarms and alarm list. Try (and fail) to recognize exit from alarm time editor.
|
File size:
942 bytes
|
Line | |
---|
1 | package net.sabi.pester;
|
---|
2 |
|
---|
3 | import java.util.Comparator;
|
---|
4 | import danger.app.DataStore;
|
---|
5 | import danger.util.StdActiveList;
|
---|
6 |
|
---|
7 | public class Alarms extends StdActiveList {
|
---|
8 | // max # records in a datastore
|
---|
9 | private static final int MAX_ALARM_COUNT = 50;
|
---|
10 |
|
---|
11 | private static Alarms sAlarmList = null;
|
---|
12 | private static DataStore sDataStore;
|
---|
13 |
|
---|
14 | private Alarms() {
|
---|
15 | sDataStore = DataStore.createDataStore("alarms", true /* auto sync */);
|
---|
16 | }
|
---|
17 |
|
---|
18 | public static Alarms getList() {
|
---|
19 | if (sAlarmList == null)
|
---|
20 | sAlarmList = new Alarms();
|
---|
21 | return sAlarmList;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public static void addAlarm(Alarm alarm) {
|
---|
25 | sAlarmList.addItem(alarm);
|
---|
26 | }
|
---|
27 | public static void removeAlarm(Alarm alarm) {
|
---|
28 | sAlarmList.removeItem(alarm);
|
---|
29 | }
|
---|
30 |
|
---|
31 | /*
|
---|
32 | private static Alarm sAlarm0 = new Alarm();
|
---|
33 | private static Alarm sAlarm1 = new Alarm();
|
---|
34 | public int compare(Object arg0, Object arg1) {
|
---|
35 |
|
---|
36 | return Collator.getInstance().compare(
|
---|
37 | }
|
---|
38 | */
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.