Home | History | Annotate | Download | only in alarms

Lines Matching defs:alarm

60      * Stores an alarm in the SharedPreferences.
64 * @param hour the integer as 24-hour format the alarm goes off
65 * @param minute the integer of the minute the alarm goes off
66 * @return the saved {@link Alarm} instance
68 public Alarm saveAlarm(int month, int date, int hour, int minute) {
69 Alarm alarm = new Alarm();
71 alarm.id = SECURE_RANDOM.nextInt();
72 alarm.month = month;
73 alarm.date = date;
74 alarm.hour = hour;
75 alarm.minute = minute;
77 editor.putString(String.valueOf(alarm.id), alarm.toJson());
79 return alarm;
88 public Set<Alarm> getAlarms() {
89 Set<Alarm> alarms = new HashSet<>();
91 alarms.add(Alarm.fromJson(entry.getValue().toString()));
97 * Delete the alarm instance passed as an argument from the SharedPreferences.
101 * @param toBeDeleted the alarm instance to be deleted
103 public void deleteAlarm(Alarm toBeDeleted) {
105 Alarm alarm = Alarm.fromJson(entry.getValue().toString());
106 if (alarm.id == toBeDeleted.id) {
108 editor.remove(String.valueOf(alarm.id));