Trull

edu.luc.cs.trull.demo.task
Class Count

java.lang.Object
  extended by edu.luc.cs.trull.demo.task.Count
All Implemented Interfaces:
Task

public class Count
extends java.lang.Object
implements Task

A simple task that wastes some CPU cycles in each step.


Field Summary
(package private)  int i
           
(package private)  int increment
           
(package private)  int max
           
 
Constructor Summary
Count(int max)
           
Count(int max, int increment)
           
 
Method Summary
 boolean hasNext()
          Returns true if the task is still in progress.
 java.lang.Object next()
          Performs the next discrete step of this task.
 void restart()
          Reinitializes this task so that it can be performed again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i

int i

increment

final int increment

max

final int max
Constructor Detail

Count

public Count(int max)

Count

public Count(int max,
             int increment)
Method Detail

hasNext

public boolean hasNext()
Description copied from interface: Task
Returns true if the task is still in progress.

Specified by:
hasNext in interface Task
Returns:
true if the task is still in progress.

next

public java.lang.Object next()
Description copied from interface: Task
Performs the next discrete step of this task.

Specified by:
next in interface Task
Returns:
the intermediate result of this step.

restart

public void restart()
Description copied from interface: Task
Reinitializes this task so that it can be performed again.

Specified by:
restart in interface Task

Trull

http://www.cs.luc.edu/trull/