当前位置: 首页>>代码示例>>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;未经允许,请勿转载。