com.kirkwarez.wdysdv.batch
Class Batch

java.lang.Object
  extended bycom.kirkwarez.wdysdv.batch.Batch

public class Batch
extends Object

The Batch class represents a batch of tasks, which you can process.

Since:
5.00
Version:
5.00
Author:
Berend "Kirk" Wouda

Field Summary
protected  ArrayList batch
          The list of batch items.
 
Constructor Summary
Batch()
          Constructs a new, empty, batch.
Batch(Task task)
          Constructs a new batch with an initial task.
 
Method Summary
 void addTask(Task task)
          Adds a task to the list.
 Iterator getIterator()
          Returns an iterator over the tasks.
 int getNumberOfTasks()
          Returns the length of this batch.
 Task getTask(int index)
          Returns the task at the index position in the batch.
 void removeAllTasks()
          Removes all the task in the batch.
 Task removeTask(int index)
          Removes and returns the task at the index position in the batch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

batch

protected ArrayList batch
The list of batch items.

Constructor Detail

Batch

public Batch()
Constructs a new, empty, batch.


Batch

public Batch(Task task)
Constructs a new batch with an initial task. Useful for immediate processing.

Method Detail

getTask

public Task getTask(int index)
Returns the task at the index position in the batch.

Parameters:
index - The position of the task in the batch.
Returns:
The task.

addTask

public void addTask(Task task)
Adds a task to the list.

Parameters:
task - The task to be added.

removeTask

public Task removeTask(int index)
Removes and returns the task at the index position in the batch.

Parameters:
index - The position of the task in the batch.
Returns:
The removed task.

removeAllTasks

public void removeAllTasks()
Removes all the task in the batch.


getNumberOfTasks

public int getNumberOfTasks()
Returns the length of this batch.

Returns:
The number of tasks in this batch.

getIterator

public Iterator getIterator()
Returns an iterator over the tasks.