Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.coaching.db.AdviceMessageDB Class Reference
Inheritance diagram for nl.sense_os.cortex.coaching.db.AdviceMessageDB:
nl.sense_os.cortex.coaching.db.CoachingDB

Public Member Functions

 AdviceMessageDB (SensePlatform sensePlatform)
 
void onCreate (SQLiteDatabase db)
 
void populateDB (SQLiteDatabase db)
 
void updateDatabase ()
 
boolean needDatebaseUpdate ()
 
boolean isPopulated ()
 
AdviceMessage getAdviceMessage (Task.TYPE task_type, Message.STYLE message_style, Message.TYPE message_type, Coach.TYPE coach_type)
 
AdviceMessage getAdviceMessage (Message message)
 
AdviceMessage getAdvice (int advice_id)
 
- Public Member Functions inherited from nl.sense_os.cortex.coaching.db.CoachingDB
 CoachingDB (SensePlatform sensePlatform, JSONObject dataStructure)
 
SQLiteDatabase getWritableDatabase ()
 
SQLiteDatabase getReadableDatabase ()
 
void onConfigure (SQLiteDatabase db)
 
void onOpen (SQLiteDatabase db)
 
void onCreate (SQLiteDatabase db)
 
void onUpgrade (SQLiteDatabase db, int oldVersion, int newVersion)
 
boolean add (JSONObject object)
 
boolean add (JSONObject object, SQLiteDatabase db)
 
JSONArray get (JSONObject criterion)
 
JSONArray get (JSONObject start_criterion, JSONObject end_criterion)
 
void clearTable ()
 

Static Public Attributes

static String KEY_TASK_TYPE = "taskType"
 
static String KEY_COACH_TYPE = "coachType"
 
static String KEY_MSG_STYLE = "msgStyle"
 
static String KEY_MSG_TYPE = "msgType"
 
static String KEY_TITLE = "title"
 
static String KEY_NOTIFICATION_TEXT = "notificationText"
 
static String KEY_TEXT = "text"
 
static String KEY_LINK = "link"
 
static String KEY_RETRIEVE_COUNT = "retrieveCount"
 
- Static Public Attributes inherited from nl.sense_os.cortex.coaching.db.CoachingDB
static final String KEY_ID = "_id"
 
static final String KEY_LOGIN_USERNAME = "login_username"
 
static final String KEY_MUTATED_AT = "mutated_at"
 

Static Protected Attributes

static String TAG = "AdviceMessageDB"
 
static AdviceAPI mAdviceAPI
 
- Static Protected Attributes inherited from nl.sense_os.cortex.coaching.db.CoachingDB
static String TAG = "CoachingDB"
 
static final String TYPE_INTEGER = " INTEGER"
 
static final String TYPE_TEXT = " TEXT"
 
static final String TYPE_DATETIME = " DATETIME"
 
static final String TYPE_REAL = " REAL"
 

Additional Inherited Members

- Protected Member Functions inherited from nl.sense_os.cortex.coaching.db.CoachingDB
String getLoginUsername ()
 
String createTableString ()
 
ContentValues toContentValues (JSONObject object)
 
String createEquals (JSONObject criterion)
 
String createBetween (JSONObject first_criterion, JSONObject second_criterion)
 
JSONObject getSingleCreterion (JSONObject first_criterion, JSONObject second_criterion)
 
JSONObject toJSONObject (Cursor c)
 
boolean update (JSONObject object)
 
boolean delete (JSONObject object)
 
- Protected Attributes inherited from nl.sense_os.cortex.coaching.db.CoachingDB
String tableName
 
JSONObject dataStructure
 
SensePlatform sensePlatform
 
boolean userAutoIncrementKey = true
 
boolean isUserSpecificTable = true
 
boolean tableCreated = false
 

Member Function Documentation

AdviceMessage nl.sense_os.cortex.coaching.db.AdviceMessageDB.getAdvice ( int  advice_id)

Get advise message

Lookup the appropriate AdviceMessage based on its identifier.

Parameters
advice_idThe AdviceMessage identifier
Returns
A random AdviceMessage
AdviceMessage nl.sense_os.cortex.coaching.db.AdviceMessageDB.getAdviceMessage ( Task.TYPE  task_type,
Message.STYLE  message_style,
Message.TYPE  message_type,
Coach.TYPE  coach_type 
)

Get AdviceMessage

Get a random AdviceNessage. Based on a Task.TYPE and Message.STYLE

Parameters
task_typeThe Task.TYPE to determine the AdviceMessage on
message_styleThe Message.STYLE to determine the AdviceMessage on
message_typeThe Message.Type to determine the AdviceMessage on
Returns
a Random AdviceMessage
AdviceMessage nl.sense_os.cortex.coaching.db.AdviceMessageDB.getAdviceMessage ( Message  message)

Get advise message for a Message

Lookup the appropriate AdviceMessage based on the input Message.

Parameters
messageThe Message to lookup the AdviceMessage for
Returns
A random AdviceMessage
void nl.sense_os.cortex.coaching.db.AdviceMessageDB.populateDB ( SQLiteDatabase  db)

Add advice messages to the database


The documentation for this class was generated from the following file: