audiojury.domain
Class Project

java.lang.Object
  |
  +--audiojury.domain.Project
All Implemented Interfaces:
java.io.Serializable

public class Project
extends java.lang.Object
implements java.io.Serializable

Represents a Project.

See Also:
Serialized Form

Field Summary
static int ACTIVE
          State constant: The project is in active state.
static int CLOSED
          State constant: The project is in closed state
static int DYNAMIC
          State constant: The project is in dynamic state.
 
Constructor Summary
Project()
          Creates a new Project object.
 
Method Summary
 void addTest(Test test)
          Adds a Test to the Project.
 Test[] getAllTests()
          Retrieves all Tests in the Project.
 Instruction getInstructions()
          Gets the Instructions for the Project.
 java.lang.String getName()
          Gets the name of the Project.
 java.lang.String[] getPersItems()
          Gets a list of all the personal information attributes to collect from the test subjects.
 int getState()
          Gets the state of the Project.
 Test getTest(java.lang.String tname)
          Retrieves a specific Test from the Project.
 java.util.Hashtable getTests()
          Returns all tests in the project except with those marked as DELETED.
 void initProject()
          Recreates internal objects lost in a serialization.
 void removeTest(java.lang.String tname)
          Removes a Test from the Project.
 void setInstructions(Instruction inst)
          Assigns an Instruction to the Project.
 void setName(java.lang.String pname)
          Sets the name of the Project.
 void setPersItems(java.lang.String[] items)
          Sets which personal information attributes to collect from the test subjects.
 void setState(int pstate)
          Set the state of a Project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DYNAMIC

public static final int DYNAMIC
State constant: The project is in dynamic state.

See Also:
Constant Field Values

ACTIVE

public static final int ACTIVE
State constant: The project is in active state.

See Also:
Constant Field Values

CLOSED

public static final int CLOSED
State constant: The project is in closed state

See Also:
Constant Field Values
Constructor Detail

Project

public Project()
Creates a new Project object.

Method Detail

initProject

public void initProject()
Recreates internal objects lost in a serialization. This method should ALWAYS and ONLY be called directly after a de-serialization of the Project has occured!


getName

public java.lang.String getName()
Gets the name of the Project.

Returns:
The name of the project.

setName

public void setName(java.lang.String pname)
Sets the name of the Project.

Parameters:
pname - The desired name.

getState

public int getState()
Gets the state of the Project. States are defined as static integers in Project.

Returns:
integer representing the state the project is in.

setState

public void setState(int pstate)
Set the state of a Project. Note that this should only be done by the ProjectManager.

Parameters:
pstate - The desired state.

addTest

public void addTest(Test test)
Adds a Test to the Project.

Parameters:
test - The Test to add.

removeTest

public void removeTest(java.lang.String tname)
Removes a Test from the Project.

Parameters:
tname - The name of the Test to remove.

getTests

public java.util.Hashtable getTests()
Returns all tests in the project except with those marked as DELETED.

Returns:
A hashtable where the name of the tests are keys.

getAllTests

public Test[] getAllTests()
Retrieves all Tests in the Project.

Tests are sorted according their Status (with a help of Test.compareTo()).
Ordering of test is important for project save operation, when first are saved VIRGIN tests, then RENAMED, NEW and last DELETED. ( TMP test is not taken into account) For NEW tests, first are saved tests which have no Origin, that means a test is not a duplicate.

Returns:
Return all Tests as a sorted a sorted set represented by TreeSet.

getTest

public Test getTest(java.lang.String tname)
Retrieves a specific Test from the Project.

Parameters:
tname - The name of the Test to retrieve.
Returns:
The specified Test object.

getInstructions

public Instruction getInstructions()
Gets the Instructions for the Project.

Returns:
The Instruction object of this project.

setInstructions

public void setInstructions(Instruction inst)
Assigns an Instruction to the Project.

Parameters:
inst - The Instruction to assign.

getPersItems

public java.lang.String[] getPersItems()
Gets a list of all the personal information attributes to collect from the test subjects.

Returns:
An array of strings with the personal information attributes to collect from the test subjects.

setPersItems

public void setPersItems(java.lang.String[] items)
Sets which personal information attributes to collect from the test subjects. The strings should be descriptive labels, such as "Name", "Age" and "Shoesize"

Parameters:
items - The array of label strings.