From caf9da1e5804aa24c8ea0440e205c30cad777b9d Mon Sep 17 00:00:00 2001 From: bspeice Date: Mon, 14 Oct 2013 13:35:21 -0400 Subject: [PATCH] Add the new AlertDB api Yay for test-driven development! --- src/com/uncc/gameday/alerts/AlertDB.java | 39 ++++++++++-------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/src/com/uncc/gameday/alerts/AlertDB.java b/src/com/uncc/gameday/alerts/AlertDB.java index 9d7f893..2aba04a 100644 --- a/src/com/uncc/gameday/alerts/AlertDB.java +++ b/src/com/uncc/gameday/alerts/AlertDB.java @@ -1,39 +1,32 @@ package com.uncc.gameday.alerts; +import java.util.Date; import java.util.List; -import android.database.sqlite.SQLiteDatabase; - -import com.uncc.gameday.GameDay; -import com.uncc.gameday.R; +/* Responsible for handling persistence/fetching of alerts */ public class AlertDB { - - private SQLiteDatabase dbHandle; - private SQLiteDatabase.CursorFactory factory; - - public AlertDB() { - this.dbHandle = SQLiteDatabase.openOrCreateDatabase(GameDay.getAppContext().getString(R.string.db_path), factory); - } - - public void insertAlert(Alert alert) { - // Add a new date to the database - } - public void insertAlerts(List alarmDates) { - // Add multiple new dates to the database + public void persist(Alert a) { + } - public void deleteAlert(Alert alert) { - // Remove a date from the database + public void persistMultiple(List alerts) { + } - public void deleteAlerts(List alerts) { - // Remove multiple dates from the database + public Alert fetch(Date d) { + + return null; } - public List fetchUnread() { - // Fetch all unread alerts + public List fetchMultiple(List dates) { + + return null; + } + + public List fetchAll() { + return null; } }