Cortex Android
 All Classes Namespaces Functions Variables
nl.sense_os.cortex.coaching.Task Class Reference

Classes

enum  STATUS
 
enum  TYPE
 

Public Member Functions

 Task (JSONObject task)
 
Task.TYPE getTaskType ()
 
JSONObject getTarget ()
 
JSONObject getValue ()
 
STATUS getStatus ()
 
double getStartDate ()
 
double getEndDate ()
 
Coach.TYPE getCoachType ()
 
List< MessagegetMessages ()
 
String getDescription ()
 
void setValueManually (JSONObject value)
 
void setValueManually (double value)
 
JSONObject toJSONObject ()
 
String toString ()
 

Static Public Member Functions

static Task getDummyTask ()
 

Protected Member Functions

 Task (Task.TYPE taskType, JSONObject target, JSONObject value, STATUS status, double startDate, double endDate, String description, Coach.TYPE coachType)
 
 Task (TaskDescription taskD)
 
void setValue (JSONObject value)
 
void setTaskType (Task.TYPE taskType)
 
void setTarget (JSONObject target)
 
void setStatus (STATUS status)
 
void setStartDate (double startDate)
 
void setEndDate (double endDate)
 
void setDescription (String description)
 
void setCoachType (Coach.TYPE coachType)
 

Constructor & Destructor Documentation

nl.sense_os.cortex.coaching.Task.Task ( JSONObject  task)

Construct Message from JSONObject

This function constructs a Message from a JSONObject.
The JSONObject should contain the data members as key-value pair

Parameters
taskThe Message represented as a JSONObject

Member Function Documentation

Coach.TYPE nl.sense_os.cortex.coaching.Task.getCoachType ( )

Get Coach.Type of the Task

Get the Coach.Type of the Task

Returns
The end date in epoch seconds
String nl.sense_os.cortex.coaching.Task.getDescription ( )

Get the Task Description

Get the description of the Task.TYPE

Returns
The description of the Task.TYPE
static Task nl.sense_os.cortex.coaching.Task.getDummyTask ( )
static

Get a dummy Task

Get an example Task

Returns
A dummy Task
double nl.sense_os.cortex.coaching.Task.getEndDate ( )

Get the Task end date

Get the end date of the Task

Returns
The end date in epoch seconds
List<Message> nl.sense_os.cortex.coaching.Task.getMessages ( )

Get the Task Messages

Get all the Messages associated with this Task.
The list will contain the Messages from this Task.TYPE with a triggerTime which lies between the Task startDate and endDate.

Returns
A list with Messages
double nl.sense_os.cortex.coaching.Task.getStartDate ( )

Get the Task start date

Get the start date of the Task

Returns
The start date in epoch seconds
STATUS nl.sense_os.cortex.coaching.Task.getStatus ( )

Get the Task status

Get the current Task.STATUS value of the task.

The Task.STATUS can be:
UNKNOWN: status is not known
IN_PROGRESS: the Task is currently active
SUCCEEDED: the Task was succeeded
FAILED: the Task has failed

Returns
The status of the Task
JSONObject nl.sense_os.cortex.coaching.Task.getTarget ( )

Get Task target value

Get the target value of the Task.
The returning JSONObject has one key: "value".
value: can contain any of the possible JSON values, but is often a double.
The JSONObject will be null if there is no value.

@return The target value JSONObject
Task.TYPE nl.sense_os.cortex.coaching.Task.getTaskType ( )

Get the Task type

Get the Task.TYPE value of the task

Returns
The Task TYPE
JSONObject nl.sense_os.cortex.coaching.Task.getValue ( )

Get the Task value

Get the current value of the Task.
The returning JSONObject has two keys: "value" and "date".
value: can contain any of the possible JSON values, but is often a double.
date: the date of the value in epoch time seconds.
The JSONObject will be null if there is no current value.

Returns
The task value JSONObject
void nl.sense_os.cortex.coaching.Task.setValueManually ( JSONObject  value)

Set the value manually

This will override the current value and finishes the task based on the input value to failed or succeeded.

Parameters
valueThe json structured value. Should contain the fields: value:json, date:double
void nl.sense_os.cortex.coaching.Task.setValueManually ( double  value)

Set the value manually

This will override the current value and finishes the task based on the input value to failed or succeeded.

Parameters
valueThe new double value of the task, The current time will be used for this value.
JSONObject nl.sense_os.cortex.coaching.Task.toJSONObject ( )

Get the JSONObject representation

Converts the Task into a JSONObject

Returns
The JSONObject representation
String nl.sense_os.cortex.coaching.Task.toString ( )

The JSON String representation

Returns an indented JSON formated String representation of the Task

Returns
The JSON formated String representation

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