net.sf.tomp.el.author
Class Tasks

java.lang.Object
  extended by net.sf.tomp.el.author.Tasks

public class Tasks
extends java.lang.Object

Author:
RNDr. Tomáš Pitner, Ph.D.

Constructor Summary
Tasks(Course c)
          Creates a new instance of Tasks, sets it course.
 
Method Summary
 void addTask(Task c)
          Adds a task to tasks.
 java.io.File getDirectory()
          Returns tasks' directory.
 java.io.File getFile()
          Returns the tasks' XML file.
 java.io.File getInfoFile()
          Returns the tasks' info XML file.
 Task getTask(java.lang.String id)
          Returns task with selected ID.
 java.util.Collection<Task> getTasks()
          Returns tasks' values.
 Task newTask(java.lang.String id)
          Creates a new Task and puts it into tasks.
 void removeTask(Task t)
          Remove the task from tasks collection and deletes its XML file.
 java.lang.String toString()
          Creates string of tasks' IDs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tasks

public Tasks(Course c)
Creates a new instance of Tasks, sets it course. Creates a new instance of its HashMap tasks.

Parameters:
c - Course containing these tasks.
Method Detail

getDirectory

public java.io.File getDirectory()
Returns tasks' directory.

Returns:
Tasks' directory

getFile

public java.io.File getFile()
Returns the tasks' XML file.

Returns:
Tasks's file

getInfoFile

public java.io.File getInfoFile()
Returns the tasks' info XML file.

Returns:
Tasks' info file

getTasks

public java.util.Collection<Task> getTasks()
Returns tasks' values.

Returns:
Collection of tasks' values.

addTask

public void addTask(Task c)
Adds a task to tasks.

Parameters:
c - Task to add

getTask

public Task getTask(java.lang.String id)
Returns task with selected ID.

Parameters:
id - ID of task to return
Returns:
Task with selected ID

toString

public java.lang.String toString()
Creates string of tasks' IDs.

Overrides:
toString in class java.lang.Object
Returns:
String containing tasks' IDs (comma-separated)

newTask

public Task newTask(java.lang.String id)
             throws java.io.IOException
Creates a new Task and puts it into tasks.

Parameters:
id - ID of new task
Returns:
Created task
Throws:
java.io.IOException

removeTask

public void removeTask(Task t)
Remove the task from tasks collection and deletes its XML file.

Parameters:
t - task to remove