it.sauronsoftware.cron4j
Class TaskTable

java.lang.Object
  extended by it.sauronsoftware.cron4j.TaskTable

public class TaskTable
extends java.lang.Object

A table coupling tasks with scheduling patterns.

Since:
2.0
Author:
Carlo Pelliccia

Constructor Summary
TaskTable()
           
 
Method Summary
 void add(SchedulingPattern pattern, Task task)
          Adds a task and an associated scheduling pattern to the table.
 SchedulingPattern getSchedulingPattern(int index)
          Returns the scheduling pattern at the specified position.
 Task getTask(int index)
          Returns the task at the specified position.
 void remove(int index)
          Remove a task from the table.
 int size()
          Returns the size of the table, representing the number of the elements stored in it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskTable

public TaskTable()
Method Detail

add

public void add(SchedulingPattern pattern,
                Task task)
Adds a task and an associated scheduling pattern to the table.

Parameters:
pattern - The associated scheduling pattern.
task - The task.

size

public int size()
Returns the size of the table, representing the number of the elements stored in it.

Returns:
The table size.

getTask

public Task getTask(int index)
             throws java.lang.IndexOutOfBoundsException
Returns the task at the specified position. Valid positions are between 0 to size() - 1.

Parameters:
index - The index.
Returns:
The task at the specified position.
Throws:
java.lang.IndexOutOfBoundsException - If the supplied index is out of range.

getSchedulingPattern

public SchedulingPattern getSchedulingPattern(int index)
                                       throws java.lang.IndexOutOfBoundsException
Returns the scheduling pattern at the specified position. Valid positions are between 0 to size() - 1.

Parameters:
index - The index.
Returns:
The scheduling pattern at the specified position.
Throws:
java.lang.IndexOutOfBoundsException - If the supplied index is out of range.

remove

public void remove(int index)
            throws java.lang.IndexOutOfBoundsException
Remove a task from the table.

Parameters:
index - The index of the task to remove.
Throws:
java.lang.IndexOutOfBoundsException - If the supplied index is not valid.
Since:
2.1