com.biocomfort.SDK.actions
Class SequenceAction

java.lang.Object
  extended by com.biocomfort.SDK.actions.SequenceAction
All Implemented Interfaces:
SDKAction

public class SequenceAction
extends java.lang.Object
implements SDKAction

Defines a sequence action that can be used to customize the devices binding or unbinding process. Use the SDK methods setBindingAction(SDKAction), setBindingAction(SDKAction,int), setUnbindingAction(SDKAction), setUnbindingAction(SDKAction,int) to do this. This action can be used to combine multiple SDKActions.

See Also:
SDK.setBindingAction(SDKAction), SDK.setBindingAction(SDKAction, int), SDK.setUnbindingAction(SDKAction), SDK.setUnbindingAction(SDKAction, int), SequenceAction, SDK.getDeviceConfigurations(MedicalDeviceTO, int)

Constructor Summary
SequenceAction()
          Creates a new SequenceAction instance and initialize it with a empty actions list.
SequenceAction(SDKAction action)
          Creates a new SequenceAction instance and adds the given action to the execution list.
SequenceAction(SDKAction action1, SDKAction action2)
          Creates a new SequenceAction instance and adds the two given actions to the execution list.
SequenceAction(SDKAction action1, SDKAction action2, SDKAction action3)
          Creates a new SequenceAction instance and adds the three given actions to the execution list.
SequenceAction(SDKAction action1, SDKAction action2, SDKAction action3, SDKAction action4)
          Creates a new SequenceAction instance and adds the four given actions to the list.
 
Method Summary
 void addAction(SDKAction action)
          Appends the specified action to the end of the execution list.
 void clearActions()
          Removes all of the action from the execution list.
 void removeAction(SDKAction action)
          Removes the first occurrence of the specified action from this list, if it is present.
 boolean runForDeviceAndWait(MedicalDeviceTO medicalDevice)
          Executes all actions of the execution list in the order they were added.
 java.lang.String toString()
          Converts this SequenceAction object to a String of the form: SequenceAction (action1,action2,...).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceAction

public SequenceAction()
Creates a new SequenceAction instance and initialize it with a empty actions list.


SequenceAction

public SequenceAction(SDKAction action)
Creates a new SequenceAction instance and adds the given action to the execution list.

Parameters:
action - the sdk action to be appended to the execution list

SequenceAction

public SequenceAction(SDKAction action1,
                      SDKAction action2)
Creates a new SequenceAction instance and adds the two given actions to the execution list.

Parameters:
action1 - the first sdk action to be appended to the execution list
action2 - the second sdk action to be appended to the execution list

SequenceAction

public SequenceAction(SDKAction action1,
                      SDKAction action2,
                      SDKAction action3)
Creates a new SequenceAction instance and adds the three given actions to the execution list.

Parameters:
action1 - the first sdk action to be appended to the execution list
action2 - the second sdk action to be appended to the execution list
action3 - the third sdk action to be appended to the execution list

SequenceAction

public SequenceAction(SDKAction action1,
                      SDKAction action2,
                      SDKAction action3,
                      SDKAction action4)
Creates a new SequenceAction instance and adds the four given actions to the list.

Parameters:
action1 - the first sdk action to be appended to the execution list
action2 - the second sdk action to be appended to the execution list
action3 - the third sdk action to be appended to the execution list
action4 - the fourth sdk action to be appended to the execution list
Method Detail

addAction

public void addAction(SDKAction action)
Appends the specified action to the end of the execution list.

Parameters:
action - action to be appended to the execution list

removeAction

public void removeAction(SDKAction action)
Removes the first occurrence of the specified action from this list, if it is present. If the list does not contain the element, it is unchanged.

Parameters:
action - element to be removed from this list, if present

clearActions

public void clearActions()
Removes all of the action from the execution list. The list will be empty after this call returns.


runForDeviceAndWait

public boolean runForDeviceAndWait(MedicalDeviceTO medicalDevice)
Executes all actions of the execution list in the order they were added. This will call the method runForDeviceAndWait for all these actions.

Note: This is a synchronous method that will block the executing thread until it is succdessfully executed or an error occures.

Specified by:
runForDeviceAndWait in interface SDKAction
Parameters:
medicalDevice - the medical device with which this actions has to be executed
Returns:
true, only if all actions are executed successfully

toString

public java.lang.String toString()
Converts this SequenceAction object to a String of the form:
 SequenceAction (action1,action2,...).
 

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this sequence action