org.keridwen.core.data.model.progress
Interface Controllable

All Known Subinterfaces:
NodeReader<T>, NodeWriter, TreeReader, TreeWriter
All Known Implementing Classes:
DefaultTreeReader, DefaultTreeWriter

public interface Controllable

A Controllable defines a class that can be controlled (i.e. interrupted, paused, etc.).


Method Summary
 void addControllableListener(ControllableListener listener)
          Adds a ControllableListener.
 void clearControllableListener()
          Clears the list of listeners.
 ControllableState getState()
          Gets the controllable state.
 void interrupt()
          Sends to the command the order to interrupt its current tasks as soon as possible.
 boolean isInterrupted()
          Checks whether this Controllable has been interrupted.
 boolean isInterruptible()
          Checks whether this Controllable can be interrupted.
 boolean isPausable()
          Checks whether this Controllable can be paused.
 void pause()
          Pauses this Command.
 void removeControllableListener(ControllableListener listener)
          Removes a ControllableListener.
 void resume()
          Resumes a paused Command.
 

Method Detail

isInterrupted

boolean isInterrupted()
Checks whether this Controllable has been interrupted.

Returns:
true if the Controllable has been interrupted.

isInterruptible

boolean isInterruptible()
Checks whether this Controllable can be interrupted.

Returns:
true if the Controllable can be interrupted.

interrupt

void interrupt()
Sends to the command the order to interrupt its current tasks as soon as possible.


isPausable

boolean isPausable()
Checks whether this Controllable can be paused.

Returns:
true if the Controllable can be paused.

pause

void pause()
Pauses this Command.


resume

void resume()
Resumes a paused Command.


getState

ControllableState getState()
Gets the controllable state.

Returns:
the controllable current state

addControllableListener

void addControllableListener(ControllableListener listener)
Adds a ControllableListener.

Parameters:
listener - the ControllableListener to add.

removeControllableListener

void removeControllableListener(ControllableListener listener)
Removes a ControllableListener.

Parameters:
listener - the ControllableListener to remove.

clearControllableListener

void clearControllableListener()
Clears the list of listeners.



Copyright © 2010-2013 Artenum. All Rights Reserved.