edu.ucsc.cs.mturk.lib.topone
Interface MyHit


public interface MyHit

This interface is provided for callback implementation. Library users must implement this interface so as to make use of the library.

During the procedure of processing questions, the algorithm needs to create HITs, retrieve answers of HITs and deal with the HITs which have returned its answers. However, these operations should be customized by library users and provided to the algorithm.

Therefore, library users need to implement all the three abstract functions and pass an instance of the implementation class into the algorithm's constructor, so that the algorithm is able to call corresponding functions to create HITs, get answers and operate past HITs.

Author:
Kerui Huang

Method Summary
 java.lang.String createMyHit(com.amazonaws.mturk.service.axis.RequesterService service, java.util.ArrayList<java.lang.Object> inputs, int numberOfOutputs, int numberOfAssignments)
          Create a HIT
 void dumpPastHit(com.amazonaws.mturk.service.axis.RequesterService service, java.lang.String hitId)
          The default operation on the HIT from which we have already got the answers.
 java.util.ArrayList<java.lang.Object> getMyHitAnswers(com.amazonaws.mturk.service.axis.RequesterService service, java.lang.String hitId)
          Get the answers of the HIT.
 

Method Detail

createMyHit

java.lang.String createMyHit(com.amazonaws.mturk.service.axis.RequesterService service,
                             java.util.ArrayList<java.lang.Object> inputs,
                             int numberOfOutputs,
                             int numberOfAssignments)
Create a HIT

Parameters:
service - the service object of the library user.
inputs - the inputs/questions for the new HIT.
numberOfOutputs - the number of required answers of the new HIT.
numberOfAssignments - the number of assignments of the new HIT.
Returns:
the new HIT's ID assigned by Amazon Mechanical Turk.

getMyHitAnswers

java.util.ArrayList<java.lang.Object> getMyHitAnswers(com.amazonaws.mturk.service.axis.RequesterService service,
                                                      java.lang.String hitId)
Get the answers of the HIT.

Parameters:
service - the service object of the library user.
hitId - the ID of the HIT
Returns:
An ArrayList of the answers of the HIT.

dumpPastHit

void dumpPastHit(com.amazonaws.mturk.service.axis.RequesterService service,
                 java.lang.String hitId)
The default operation on the HIT from which we have already got the answers.

Parameters:
service - the service object of the library user.
hitId - the ID of the HIT