當前位置: 首頁>>代碼示例>>Java>>正文


Java DataPoint類代碼示例

本文整理匯總了Java中com.amazonaws.mturk.requester.DataPoint的典型用法代碼示例。如果您正苦於以下問題:Java DataPoint類的具體用法?Java DataPoint怎麽用?Java DataPoint使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataPoint類屬於com.amazonaws.mturk.requester包,在下文中一共展示了DataPoint類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getRequesterWorkerStatistic

import com.amazonaws.mturk.requester.DataPoint; //導入依賴的package包/類
public DataPoint[] getRequesterWorkerStatistic(
    RequesterStatistic statistic, TimePeriod timePeriod,
    String workerId, Integer count, String[] responseGroup)
throws ServiceException {
  
  GetRequesterWorkerStatisticRequest request = new GetRequesterWorkerStatisticRequest();
  if (statistic != null) request.setStatistic(statistic);
  if (timePeriod != null) request.setTimePeriod(timePeriod);
  if (workerId != null) request.setWorkerId(workerId);
  if (count != null) request.setCount(count);
  if (responseGroup != null) request.setResponseGroup(responseGroup);
  
  GetStatisticResult result = null;
  result = (GetStatisticResult) executeRequest(request,
      ResultMatch.GetRequesterWorkerStatistic.name(),
      ResultMatch.GetRequesterWorkerStatistic.getResultTypeName());
  if (result == null) {
    throw new ServiceException("No response");
  }
  return result.getDataPoint();
}
 
開發者ID:dbarowy,項目名稱:java-aws-mturk,代碼行數:22,代碼來源:RequesterServiceRaw.java

示例2: getRequesterStatistic

import com.amazonaws.mturk.requester.DataPoint; //導入依賴的package包/類
/**
 * @see http://docs.amazonwebservices.com/AWSMechanicalTurkRequester/2007-03-12/ApiReference_GetRequesterStatisticOperation.html
 */ 
public DataPoint[] getRequesterStatistic(RequesterStatistic statistic, TimePeriod timePeriod, 
    Integer count) throws ServiceException { 

  GetRequesterStatisticRequest request = new GetRequesterStatisticRequest();
  if (count != null)      request.setCount(count);
  if (statistic != null)  request.setStatistic(statistic);
  if (timePeriod != null) request.setTimePeriod(timePeriod);

  GetStatisticResult result = null;
  result = (GetStatisticResult) executeRequest(request, 
      ResultMatch.GetRequesterStatistic.name(),
      ResultMatch.GetRequesterStatistic.getResultTypeName());

  if (result == null || result.getDataPoint() == null) {
    throw new ServiceException("No response");
  }

  return result.getDataPoint();
}
 
開發者ID:dbarowy,項目名稱:java-aws-mturk,代碼行數:23,代碼來源:RequesterServiceRaw.java

示例3: testGetRequesterStatistic

import com.amazonaws.mturk.requester.DataPoint; //導入依賴的package包/類
public void testGetRequesterStatistic() throws ServiceException {
  DataPoint[] result = service.getRequesterStatistic(
      RequesterStatistic.AverageRewardAmount,
      TimePeriod.OneDay, 1 // count
  );
  
  assertNotNull(result);
}
 
開發者ID:dbarowy,項目名稱:java-aws-mturk,代碼行數:9,代碼來源:TestRequesterServiceRaw.java

示例4: testGetRequesterWorkerStatistic

import com.amazonaws.mturk.requester.DataPoint; //導入依賴的package包/類
public void testGetRequesterWorkerStatistic() throws ServiceException {
  DataPoint[] datum = service.getRequesterWorkerStatistic(
      RequesterStatistic.NumberAssignmentsApproved,
      TimePeriod.LifeToDate,
      luckyWorker,
      null, // count
      null); // responseGroup
  assertEquals("Unexpected number of DataPoints returned", datum.length, 1);
  assertNotNull("Returned DataPoint was null", datum[0]);
}
 
開發者ID:dbarowy,項目名稱:java-aws-mturk,代碼行數:11,代碼來源:TestRequesterServiceRaw.java

示例5: getStatistic

import com.amazonaws.mturk.requester.DataPoint; //導入依賴的package包/類
/**
 * Helper function: returns a life-to-date statistic for the specified worker
 * @param workerId
 * @param statistic
 * @return
 */
private String getStatistic(String workerId, RequesterStatistic statistic) {
  DataPoint[] stat =
    service.getRequesterWorkerStatistic(
        statistic,
        TimePeriod.LifeToDate,
        workerId,
        null, // count
        new String[] {"Minimal"}); // responseGroup
  if (stat[0].getLongValue() != null) {
      return stat[0].getLongValue().toString();
  } else {
      return stat[0].getDoubleValue().toString();
  }
}
 
開發者ID:dbarowy,項目名稱:java-aws-mturk,代碼行數:21,代碼來源:ReviewPolicyExample.java


注:本文中的com.amazonaws.mturk.requester.DataPoint類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。