edu.ucsc.cs.mturk.lib.topone
Class BubbleAlgorithm.Builder

java.lang.Object
  extended by edu.ucsc.cs.mturk.lib.topone.BubbleAlgorithm.Builder
Enclosing class:
BubbleAlgorithm

public static class BubbleAlgorithm.Builder
extends java.lang.Object

This class is for creating a bubble algorithm in Builder pattern.

Version:
1.1
Author:
Kerui Huang

Constructor Summary
BubbleAlgorithm.Builder(java.util.ArrayList<java.lang.Object> questions, MyHit myHit)
          Constructs a Builder with questions and myHit.
 
Method Summary
 BubbleAlgorithm build()
          Create a new instance of TreeAlgorithm.
 BubbleAlgorithm.Builder inputSize(int inputSize)
          Set the number of inputs of a HIT.
 BubbleAlgorithm.Builder isLogged(boolean isLogged)
          Set whether the algorithm records the computation process.
 BubbleAlgorithm.Builder isShuffled(boolean isShuffled)
          Set whether the inputs are shuffled by the algorithm.
 BubbleAlgorithm.Builder jobId(java.lang.String jobId)
          Set the job ID for this algorithm instance.
 BubbleAlgorithm.Builder logName(java.lang.String logName)
          Set the name of the log file.
 BubbleAlgorithm.Builder numberOfAssignments(int numberOfAssignments)
          Set the number of assignments for a normal HIT.
 BubbleAlgorithm.Builder numberOfTieAssignments(int numberOfTieAssignments)
          Set the number of assignments for a tie-solving HIT.
 BubbleAlgorithm.Builder outputSize(int outputSize)
          Set the number of outputs of a HIT.
 BubbleAlgorithm.Builder propertyFile(java.lang.String propertyFileName)
          Set the name of the the name of the MTurk property file.
 BubbleAlgorithm.Builder service(com.amazonaws.mturk.service.axis.RequesterService service)
          Set the service object of the library user.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BubbleAlgorithm.Builder

public BubbleAlgorithm.Builder(java.util.ArrayList<java.lang.Object> questions,
                               MyHit myHit)
Constructs a Builder with questions and myHit.

Parameters:
questions - the questions to be solved by workers.
myHit - the object which implements MyHit interface and provides callback functions.
Method Detail

service

public BubbleAlgorithm.Builder service(com.amazonaws.mturk.service.axis.RequesterService service)
Set the service object of the library user.

Parameters:
service - the service object of the library user.
Returns:
the Builder object itself.

propertyFile

public BubbleAlgorithm.Builder propertyFile(java.lang.String propertyFileName)
Set the name of the the name of the MTurk property file.

Parameters:
propertyFileName - the name of the property file.
Returns:
the Builder object itself.

inputSize

public BubbleAlgorithm.Builder inputSize(int inputSize)
Set the number of inputs of a HIT.

Parameters:
inputSize - the number of inputs of a HIT.
Returns:
the Builder object itself.

outputSize

public BubbleAlgorithm.Builder outputSize(int outputSize)
Set the number of outputs of a HIT.

Parameters:
outputSize - the number of outputs of a HIT.
Returns:
the Builder object itself.

numberOfAssignments

public BubbleAlgorithm.Builder numberOfAssignments(int numberOfAssignments)
Set the number of assignments for a normal HIT.

Parameters:
numberOfAssignments - the number of assignments for a normal HIT.
Returns:
the Builder object itself.

numberOfTieAssignments

public BubbleAlgorithm.Builder numberOfTieAssignments(int numberOfTieAssignments)
Set the number of assignments for a tie-solving HIT.

Parameters:
numberOfTieAssignments - the number of assignments for a tie-solving HIT.
Returns:
the Builder object itself.

isShuffled

public BubbleAlgorithm.Builder isShuffled(boolean isShuffled)
Set whether the inputs are shuffled by the algorithm.

Parameters:
isShuffled - true if the inputs are shuffled by the algorithm.
Returns:
the Builder object itself.

isLogged

public BubbleAlgorithm.Builder isLogged(boolean isLogged)
Set whether the algorithm records the computation process.

Parameters:
isLogged - true if the algorithm records the computation process.
Returns:
the Builder object itself.

logName

public BubbleAlgorithm.Builder logName(java.lang.String logName)
Set the name of the log file.

Parameters:
logName - the name of the log file.
Returns:
the Builder object itself.

jobId

public BubbleAlgorithm.Builder jobId(java.lang.String jobId)
Set the job ID for this algorithm instance.

Parameters:
jobId - the job ID for this algorithm instance.
Returns:
the Builder object itself.

build

public BubbleAlgorithm build()
Create a new instance of TreeAlgorithm.

Returns:
the newly created instance of TreeAlgorithm.