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