net.sf.tomp.el.author
Class Projects

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

public class Projects
extends java.lang.Object


Constructor Summary
Projects(Course c)
          Creates a new instance of Projects and sets its course.
 
Method Summary
 void addProject(Project c)
          Adds a project to projects.
 java.io.File getDirectory()
          Returns Projects' directory.
 java.io.File getFile()
          Returns the projects' XML file.
 Project getFirstProject()
          Returns first project in projects map.
 java.io.File getInfoFile()
          Returns the projects' info XML file.
 Project getProject(java.lang.String id)
          Returns project with selected ID.
 java.util.Collection<Project> getProjects()
          Returns projects' values.
 Project newProject(java.lang.String id)
          Creates a new project and puts it into lprojects.
 void removeProject(Project p)
          Remove the project from projects collection and deletes its XML file.
 java.lang.String toString()
          Creates string of proejcts' IDs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Projects

public Projects(Course c)
Creates a new instance of Projects and sets its course. Creates a new instance of its TreeMap Projects.

Parameters:
c - Course containing these projects.
Method Detail

getDirectory

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

Returns:
Projects' directory

getFile

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

Returns:
Projects' file

getInfoFile

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

Returns:
Projects' info file

getProjects

public java.util.Collection<Project> getProjects()
Returns projects' values.

Returns:
Collection of projects' values

addProject

public void addProject(Project c)
Adds a project to projects.

Parameters:
c - Project to add

newProject

public Project newProject(java.lang.String id)
                   throws java.io.IOException
Creates a new project and puts it into lprojects.

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

removeProject

public void removeProject(Project p)
Remove the project from projects collection and deletes its XML file.

Parameters:
p - project to remove

getProject

public Project getProject(java.lang.String id)
Returns project with selected ID.

Parameters:
id - ID of project to return
Returns:
Project with selected ID

getFirstProject

public Project getFirstProject()
Returns first project in projects map.

Returns:
First project in projects.

toString

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

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