talx x1.0.5

util
Interface TaskProperties

All Known Implementing Classes:
TrainingPanel.TaskPropertyMap

public interface TaskProperties

Class used by TrainingComponents to pass information about the current task. When the


Field Summary
static java.lang.String CANCELLED
           
static java.lang.String FAILED
           
static java.lang.String ONGOING
           
static java.lang.String PASSED
           
 
Method Summary
 java.lang.String get(java.lang.String key)
          Retrieves the value of the key.
 Constraint getCompletionConstraint()
          Returns the failure condition (if any).
 java.lang.String getCompletionReason()
          Returns the failure condition (if any).
 java.lang.String getCompletionStatus()
           
 int getInt(java.lang.String key)
          Retrieves the value of the key as an int, if possible.
 Settings getSettings()
          Returns the settings for the application.
 boolean isCompleted()
           
 boolean isSuccessful()
           
 void put(java.lang.String key, int value)
          Associates the value with the key.
 void put(java.lang.String key, java.lang.String value)
          Associates the value with the key.
 void setCancelled()
          Called to indicate the user abandoned the task.
 void setCompleted(boolean success, Constraint constraint, java.lang.String reason)
          Called to indicate the user completed the task.
 

Field Detail

CANCELLED

public static final java.lang.String CANCELLED
See Also:
Constant Field Values

PASSED

public static final java.lang.String PASSED
See Also:
Constant Field Values

FAILED

public static final java.lang.String FAILED
See Also:
Constant Field Values

ONGOING

public static final java.lang.String ONGOING
See Also:
Constant Field Values
Method Detail

get

public java.lang.String get(java.lang.String key)
Retrieves the value of the key.

Returns:
value associated with the key, or null if the key does not exist.

put

public void put(java.lang.String key,
                java.lang.String value)
Associates the value with the key.


getInt

public int getInt(java.lang.String key)
Retrieves the value of the key as an int, if possible.

Returns:
the interger value of the key or zero if the key does not exist, or is not an integer.

put

public void put(java.lang.String key,
                int value)
Associates the value with the key.


setCompleted

public void setCompleted(boolean success,
                         Constraint constraint,
                         java.lang.String reason)
                  throws java.lang.IllegalStateException
Called to indicate the user completed the task.

Parameters:
success - if true, the user successfully completed the task.
constraint - The constraint that called this method.
reason - The text given here should be documented in the constraint.
Throws:
IlllegalStateException - if the task has already been cancelled or completed
java.lang.IllegalStateException

setCancelled

public void setCancelled()
                  throws java.lang.IllegalStateException
Called to indicate the user abandoned the task.

Throws:
IlllegalStateException - if the task has already been cancelled or completed
java.lang.IllegalStateException

isCompleted

public boolean isCompleted()
Returns:
true if the task was completed or abandoned by the user.

isSuccessful

public boolean isSuccessful()
                     throws ValueNotSetException
Returns:
true if the user successfully completed the task, or false if the user unsuccessfully completed the task.
Throws:
ValueNotSetException - if the task was cancelled.

getCompletionStatus

public java.lang.String getCompletionStatus()

getCompletionReason

public java.lang.String getCompletionReason()
Returns the failure condition (if any).

Returns:
the string specified when setCompleted was called, or the empty string if the task was cancelled or not yet completed.

getCompletionConstraint

public Constraint getCompletionConstraint()
Returns the failure condition (if any).

Returns:
the Constraint object specified when setCompleted was called, or the empty string if the task was cancelled or not yet completed.

getSettings

public Settings getSettings()
Returns the settings for the application.


talx x1.0.5

© 2001-2005 University of Oregon.
Eugene OR 97403, U.S.A. All Rights Reserved.