net.sf.tomp.el.author
Class Practices

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

public class Practices
extends java.lang.Object


Constructor Summary
Practices(Course c)
          Creates a new instance of Practices and sets its course.
 
Method Summary
 void addPractice(Practice c)
          Adds a practice to practices.
 java.io.File getDirectory()
          Returns Practices' directory.
 java.io.File getFile()
          Returns the practices' XML file.
 Practice getFirstPractice()
          Returns first practice in practices map.
 java.io.File getInfoFile()
          Returns the practices' info XML file.
 Practice getPractice(java.lang.String id)
          Returns practice with selected ID.
 java.util.Collection<Practice> getPractices()
          Returns practices' values.
 Practice newPractice(java.lang.String id)
          Creates a new practice and puts it into practices.
 void removePractice(Practice l)
          Remove the practice from practices collection and deletes its XML file.
 java.lang.String toString()
          Creates string of practices' IDs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Practices

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

Parameters:
c - Course containing these practices.
Method Detail

getDirectory

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

Returns:
Practices' directory

getFile

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

Returns:
Practices' file

getInfoFile

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

Returns:
Practices' info file

getPractices

public java.util.Collection<Practice> getPractices()
Returns practices' values.

Returns:
Collection of practices' values

addPractice

public void addPractice(Practice c)
Adds a practice to practices.

Parameters:
c - Practice to add

newPractice

public Practice newPractice(java.lang.String id)
                     throws java.io.IOException
Creates a new practice and puts it into practices.

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

removePractice

public void removePractice(Practice l)
Remove the practice from practices collection and deletes its XML file.

Parameters:
l - practice to remove

getPractice

public Practice getPractice(java.lang.String id)
Returns practice with selected ID.

Parameters:
id - ID of practice to return
Returns:
Practice with selected ID

getFirstPractice

public Practice getFirstPractice()
Returns first practice in practices map.

Returns:
First practice in practices.

toString

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

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