public class Result
extends java.lang.Object
implements java.io.Serializable
ViewTaskActivity
or StepLayout
. Certain types of results can contain other
results, which together express a hierarchy; examples of these types of results are StepResult
and TaskResult
.
Every object in the result hierarchy has an identifier that should correspond to the identifier
of an object in the original step hierarchy. Similarly, every object has a start date and an end
date that correspond to the range of times during which the result was collected. In an StepResult
object, for example, the start and end dates cover the range of time during which the
step view controller was visible on screen.
When you implement a new type of step, it is usually helpful to create a new Result subclass to hold the type of result data the step can generate, unless it makes sense to use an existing subclass.
Constructor and Description |
---|
Result(java.lang.String identifier)
Returns an initialized result using the specified identifier.
|
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getEndDate()
Returns the time when the task, step, or data collection stopped.
|
java.lang.String |
getIdentifier()
Returns a meaningful identifier for the result.
|
java.util.Date |
getStartDate()
Returns the time when the task, step, or data collection began.
|
void |
setEndDate(java.util.Date endDate)
Sets the end time for this result
|
void |
setStartDate(java.util.Date startDate)
Sets the start time for this result
|
public Result(java.lang.String identifier)
Typically, objects such as ViewTaskActivity
and StepLayout
instantiate result (and Result
subclass) objects; you seldom need to instantiate a result object in your code.
identifier
- The unique identifier of the result.public java.lang.String getIdentifier()
The identifier can be used to identify the question that was asked or the task that was completed to produce the result. Typically, the identifier is copied from the originating object.
For example, a task result receives its identifier from a task, a step result receives its identifier from a step, and a question result receives its identifier from a step or a form step.
public java.util.Date getStartDate()
public void setStartDate(java.util.Date startDate)
startDate
- the time the result startedpublic java.util.Date getEndDate()
public void setEndDate(java.util.Date endDate)
endDate
- the end date of this result