talx x1.0.5

desktop
Class TrainingPanel.TaskPropertyMap

java.lang.Object
  extended bydesktop.TrainingPanel.TaskPropertyMap
All Implemented Interfaces:
TaskProperties
Enclosing class:
TrainingPanel

protected class TrainingPanel.TaskPropertyMap
extends java.lang.Object
implements TaskProperties


Field Summary
 
Fields inherited from interface util.TaskProperties
CANCELLED, FAILED, ONGOING, PASSED
 
Constructor Summary
TrainingPanel.TaskPropertyMap(TrainingPanel.KeyValue[] monitoredKeys, java.lang.String[] allowedQueries)
           
 
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()
          Returns true if the task has been passed, failed or cancelled.
 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()
          Sets the task as cancelled.
 void setCompleted(boolean success, Constraint constraint, java.lang.String reason)
          Called to indicate the user completed the task.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrainingPanel.TaskPropertyMap

public TrainingPanel.TaskPropertyMap(TrainingPanel.KeyValue[] monitoredKeys,
                                     java.lang.String[] allowedQueries)
Method Detail

getSettings

public Settings getSettings()
Description copied from interface: TaskProperties
Returns the settings for the application.

Specified by:
getSettings in interface TaskProperties

getInt

public int getInt(java.lang.String key)
Description copied from interface: TaskProperties
Retrieves the value of the key as an int, if possible.

Specified by:
getInt in interface TaskProperties
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)
Description copied from interface: TaskProperties
Associates the value with the key.

Specified by:
put in interface TaskProperties

get

public java.lang.String get(java.lang.String key)
Description copied from interface: TaskProperties
Retrieves the value of the key.

Specified by:
get in interface TaskProperties
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)
Description copied from interface: TaskProperties
Associates the value with the key.

Specified by:
put in interface TaskProperties

setCompleted

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

Specified by:
setCompleted in interface TaskProperties
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:
java.lang.IllegalStateException

setCancelled

public void setCancelled()
                  throws java.lang.IllegalStateException
Sets the task as cancelled.

Specified by:
setCancelled in interface TaskProperties
Throws:
java.lang.IllegalStateException

isCompleted

public boolean isCompleted()
Returns true if the task has been passed, failed or cancelled.

Specified by:
isCompleted in interface TaskProperties
Returns:
true if the task was completed or abandoned by the user.

isSuccessful

public boolean isSuccessful()
                     throws ValueNotSetException
Specified by:
isSuccessful in interface TaskProperties
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.

getCompletionReason

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

Specified by:
getCompletionReason in interface TaskProperties
Returns:
the string specified when setCompleted was called, or the empty string if the task was cancelled or not completed.

getCompletionStatus

public java.lang.String getCompletionStatus()
Specified by:
getCompletionStatus in interface TaskProperties

getCompletionConstraint

public Constraint getCompletionConstraint()
Description copied from interface: TaskProperties
Returns the failure condition (if any).

Specified by:
getCompletionConstraint in interface TaskProperties
Returns:
the Constraint object specified when setCompleted was called, or the empty string if the task was cancelled or not yet completed.

toString

public java.lang.String toString()
Returns:
If the task has been completed, this method returns passed, failed, or cancelled, followed by the reason. If the task has not been completed, this method returns the list of key value pairs.

talx x1.0.5

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