Example #1
0
  public List<AlarmModel> getAll() {
    List<AlarmModel> alarmList = new ArrayList<>();
    for (LinkedHashMap<String, Column> m : alarmTable.getAllRows()) {
      alarmList.add(getValues(m));
    }

    database.closeDatabase();
    return alarmList;
  }
Example #2
0
 // Delete all data
 public void clearAll() {
   alarmTable.clearAll();
   database.closeDatabase();
 }
Example #3
0
 public int update(AlarmModel entry) {
   int TempInt = (int) alarmTable.update(putValues(entry), KEY);
   database.closeDatabase();
   return TempInt;
 }
Example #4
0
 public AlarmModel get(int id) {
   LinkedHashMap<String, Column> m = alarmTable.getRowByValue(KEY, id).getMap();
   AlarmModel alarm = getValues(m);
   database.closeDatabase();
   return alarm;
 }
Example #5
0
 public long addAndGetID(AlarmModel entry) {
   long value = alarmTable.addRow(putValues(entry));
   database.closeDatabase();
   return value;
 }
Example #6
0
 public void add(AlarmModel entry) {
   alarmTable.addRow(putValues(entry));
   database.closeDatabase();
 }
Example #7
0
 // Drop
 public void drop() {
   alarmTable.drop();
   database.closeDatabase();
 }
Example #8
0
 // Deleting single entry
 public void delete(AlarmModel entry) {
   alarmTable.delete(KEY, entry.getId());
   database.closeDatabase();
 }