Cytoscape 2.8.0 API

cytoscape.task.sample
Class SampleTask

java.lang.Object
  extended by cytoscape.task.sample.SampleTask
All Implemented Interfaces:
Haltable, Task, Runnable

public class SampleTask
extends Object
implements Task

Sample Task, used to illustrate the Task Framework. This tasks counts from 0 to maxValue.


Constructor Summary
SampleTask(int max, long countDelay)
          Constructor.
SampleTask(int max, long countDelay, int exceptionIndex)
          Constructor.
 
Method Summary
 String getTitle()
          Gets the Task Title.
 void halt()
          Non-blocking call to interrupt the task.
 void run()
          Run the Task.
 void setTaskMonitor(TaskMonitor taskMonitor)
          Sets the Task Monitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleTask

public SampleTask(int max,
                  long countDelay)
Constructor.

Parameters:
max - Max Count Value.
countDelay - Delay between each count (in milliseconds).

SampleTask

public SampleTask(int max,
                  long countDelay,
                  int exceptionIndex)
Constructor. Provides a test of Exception Handling. The Task will throw a NullPointerException when it reaches the exceptionIndex value.

Parameters:
max - Max Count Value.
countDelay - Delay between each count (in milliseconds).
exceptionIndex - The Task will throw a NullPointerException when it reaches the exceptionIndex value.
Method Detail

run

public void run()
Run the Task.

Specified by:
run in interface Task
Specified by:
run in interface Runnable

halt

public void halt()
Non-blocking call to interrupt the task.

Specified by:
halt in interface Haltable
Specified by:
halt in interface Task

setTaskMonitor

public void setTaskMonitor(TaskMonitor taskMonitor)
Sets the Task Monitor.

Specified by:
setTaskMonitor in interface Task
Parameters:
taskMonitor - TaskMonitor Object.

getTitle

public String getTitle()
Gets the Task Title.

Specified by:
getTitle in interface Task
Returns:
human readable task title.

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.