audiojury.action
Class TestBuilder

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

public class TestBuilder
extends java.lang.Object

Does operations on a Test.
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 tests impossible. The TestBuilder only operates on one test at a time.

See Also:
Test

Method Summary
 void addPractice(Judgement judg)
          Add a Judgement to the set of practice judgements.
 void addPracticeFromReal(int realindex)
          Takes a Judgement from the set of judgements to run "real" and makes it part of the practice judgement set as well.
 void addReal(Judgement judg)
          Add a Judgement to the Test.
 Test getCurrentTest()
          Gets the Test currently being build on.
 TestMethod getMethod()
          Gets the TestMethod of the current test.
 java.util.Vector getPracticeJudgements()
          Retrieves a vector of the practice Judgements in the current Test.
 java.util.Vector getRealJudgements()
          Retrieves a vector of the Judgements in the current Test.
static TestBuilder getUniqueInstance()
          Enforces the Singleton design pattern by always returning the same instance of TestBuilder.
 void removePractice(int index)
          Remove a Judgement from the set of practice judgements.
 void removeReal(int index)
          Remove a Judgement from the Test.
 void setCurrentTest(Test test)
          Sets which Test to build on.
 void setInstructions(Instruction instr)
          Assigns an Instruction to the current project.
 void setInterMode(int imode)
          Sets the interaction mode.
 void setMethod(TestMethod method)
          Set TestMethodof this Test.
 void setRandomizeJudgements(boolean rnd)
          Sets the Judgement randomization mode.
 void setRandomizePairs(boolean rnd)
          Sets the pair randomization mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrentTest

public Test getCurrentTest()
Gets the Test currently being build on.

Returns:
The Test currently being build on.

getMethod

public TestMethod getMethod()
Gets the TestMethod of the current test.

Returns:
The TestMethod of the current test.

setCurrentTest

public void setCurrentTest(Test test)
Sets which Test to build on.

Parameters:
test - The Test to set as current.

addReal

public void addReal(Judgement judg)
Add a Judgement to the Test.

Parameters:
judg - A judgeJudgement ment to add.

removeReal

public void removeReal(int index)
Remove a Judgement from the Test.

Parameters:
index - Index to the Judgement to remove.

getRealJudgements

public java.util.Vector getRealJudgements()
Retrieves a vector of the Judgements in the current Test.

Returns:
A vector of Judgements in the current Test.

addPractice

public void addPractice(Judgement judg)
Add a Judgement to the set of practice judgements.

Parameters:
judg - A Judgement to add.

removePractice

public void removePractice(int index)
Remove a Judgement from the set of practice judgements.

Parameters:
index - Index to the Judgement to remove.

getPracticeJudgements

public java.util.Vector getPracticeJudgements()
Retrieves a vector of the practice Judgements in the current Test.

Returns:
A vector containing the practice Judgements.

setInterMode

public void setInterMode(int imode)
Sets the interaction mode. Can be INTER_AUTO for automatic mode or INTER_INTER for interactive mode.

Parameters:
imode - The desired mode.

setRandomizePairs

public void setRandomizePairs(boolean rnd)
Sets the pair randomization mode. If the pair randomization mode is on, in half of the Judgements the first and second sounds in the pair are randomly swapped when the Project is run.

Parameters:
rnd - Set to true to enable pair randomization, false to disable.

setRandomizeJudgements

public void setRandomizeJudgements(boolean rnd)
Sets the Judgement randomization mode. If the randomization mode is on the order of judgements is randomized.

Parameters:
rnd - Set to true to enable Judgement randomization, false to disable.

setMethod

public void setMethod(TestMethod method)
Set TestMethodof this Test. (ACR, CCR, DCR etc)

Parameters:
method - The desired TestMethod.

setInstructions

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

Parameters:
instr - The Instruction to set.

addPracticeFromReal

public void addPracticeFromReal(int realindex)
Takes a Judgement from the set of judgements to run "real" and makes it part of the practice judgement set as well.

Parameters:
realindex - Index to the Judgement in the real set.

getUniqueInstance

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

Returns:
A unique single TestBuilder insatance.