audiojury.action
Class ProjectBuilder

java.lang.Object
  |
  +--audiojury.action.ProjectBuilder

public class ProjectBuilder
extends java.lang.Object

Does simple operations on a dynamic Project.
The class implements the Singleton design pattern, which means there is only one instance of this class. This is necessary to make concurrent access to projects impossible. The ProjectBuilder only operates on one project at a time.


Method Summary
 Project getCurrentProject()
          Returns the Project currently being built upon.
static ProjectBuilder getUniqueInstance()
          Enforces the Singleton design pattern by always returning the same instance of ProjectBuilder.
 void setCurrentProject(Project project)
          Sets which Project to make as current.
 void setInstructions(Instruction inst)
          Assigns Instruction to the current project.
 void setPersItems(java.lang.String[] items)
          Assigns which personal attributes to collect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrentProject

public Project getCurrentProject()
Returns the Project currently being built upon.

Returns:
The current project

setCurrentProject

public void setCurrentProject(Project project)
Sets which Project to make as current. In other words, which Project to perform future operations on.

Parameters:
project - The Project to build.

setInstructions

public void setInstructions(Instruction inst)
Assigns Instruction to the current project.

Parameters:
inst - The Instruction to set.

setPersItems

public void setPersItems(java.lang.String[] items)
Assigns which personal attributes to collect.

Parameters:
items - An array of text strings which label the personal attributes. The labels should be descriptive since they are shown to the user when running a project. Example ["Name", "Age", "Sex"]

getUniqueInstance

public static ProjectBuilder getUniqueInstance()
Enforces the Singleton design pattern by always returning the same instance of ProjectBuilder. This should be used instead of a constructor.

Returns:
A unique single ProjectBuilder insatance.