Java 类com.amazonaws.mturk.filter.Filter 实例源码

项目:java-aws-mturk    文件:FilteredAWSService.java   
/**
 * 
 * @param filterList - List of Filters that should be executed.
 * Also appends the FinalFilter, which makes the wsdl call, to the List
 */
public FilteredAWSService(ClientConfig config, List<Filter> filterList) {
    super(config);
    this.filterList = new LinkedList<Filter>(filterList);
    this.filterList.addLast(new FinalFilter(this));
    Filter.linkFilters(this.filterList);
}
项目:java-aws-mturk    文件:FilteredAWSService.java   
/**
 * 
 * @param filter - Removes the Filter from List of Filters, if it is remavable and found in the list
 * Throws RuntimeException if filter not found in list or not removable
 */
public void removeFilter(Filter filter) {
    if (!filter.isRemovable()) 
        throw new RuntimeException("Filter cannot be removed" + filter);

    if (!this.filterList.remove(filter))
        throw new RuntimeException("Filter not found in list" + filter);

    Filter.linkFilters(this.filterList);
}
项目:java-aws-mturk    文件:FilteredAWSService.java   
/**
 * Clears all filters which are removable from the List of Filters
 *
 */
public void clearFilters() {
    for (Iterator<Filter> iterator = filterList.iterator(); iterator.hasNext();) {
        Filter filter = iterator.next();
        if (filter.isRemovable()) {
            iterator.remove();
        }
    }
    Filter.linkFilters(this.filterList);
}
项目:java-aws-mturk    文件:TestFilter.java   
public void testChangeReward() throws ServiceException {
    Filter filter = new CheckRewardFilter();
    service.addFilter(filter);
    String hitId = service.createHIT(defaultHITTitle + unique, defaultHITDescription, defaultReward, 
        RequesterService.getBasicFreeTextQuestion(defaultQuestion), defaultMaxAssignments).getHITId();

    HIT hit = service.getHIT(hitId);  
    assertEquals(hit.getReward().getAmount().doubleValue(), 0.05);
    service.removeFilter(filter);
}
项目:mturksdk-java-code-maven    文件:FilteredAWSService.java   
/**
 * 
 * @param filterList - List of Filters that should be executed.
 * Also appends the FinalFilter, which makes the wsdl call, to the List
 */
public FilteredAWSService(ClientConfig config, List<Filter> filterList) {
    super(config);
    this.filterList = new LinkedList<Filter>(filterList);
    this.filterList.addLast(new FinalFilter(this));
    Filter.linkFilters(this.filterList);
}
项目:mturksdk-java-code-maven    文件:FilteredAWSService.java   
/**
 * 
 * @param filter - Removes the Filter from List of Filters, if it is remavable and found in the list
 * Throws RuntimeException if filter not found in list or not removable
 */
public void removeFilter(Filter filter) {
    if (!filter.isRemovable()) 
        throw new RuntimeException("Filter cannot be removed" + filter);

    if (!this.filterList.remove(filter))
        throw new RuntimeException("Filter not found in list" + filter);

    Filter.linkFilters(this.filterList);
}
项目:mturksdk-java-code-maven    文件:FilteredAWSService.java   
/**
 * Clears all filters which are removable from the List of Filters
 *
 */
public void clearFilters() {
    for (Iterator<Filter> iterator = filterList.iterator(); iterator.hasNext();) {
        Filter filter = iterator.next();
        if (filter.isRemovable()) {
            iterator.remove();
        }
    }
    Filter.linkFilters(this.filterList);
}
项目:mturksdk-java-code-maven    文件:TestFilter.java   
public void testChangeReward() throws ServiceException {
    Filter filter = new CheckRewardFilter();
    service.addFilter(filter);
    String hitId = service.createHIT(defaultHITTitle + unique, defaultHITDescription, defaultReward, 
        RequesterService.getBasicFreeTextQuestion(defaultQuestion), defaultMaxAssignments).getHITId();

    HIT hit = service.getHIT(hitId);  
    assertEquals(hit.getReward().getAmount().doubleValue(), 0.05);
    service.removeFilter(filter);
}
项目:java-aws-mturk    文件:FilteredAWSService.java   
/**
 * 
 * @param filter - Adds the Filter implementaion to head of the List of Filters
 */
public void addFilter(Filter filter) {
    this.filterList.addFirst(filter);
    Filter.linkFilters(this.filterList);
}
项目:java-aws-mturk    文件:MyHIT.java   
public void appendFilter(Filter filter) {
    service.addFilter(filter);
}
项目:mturksdk-java-code-maven    文件:FilteredAWSService.java   
/**
 * 
 * @param filter - Adds the Filter implementaion to head of the List of Filters
 */
public void addFilter(Filter filter) {
    this.filterList.addFirst(filter);
    Filter.linkFilters(this.filterList);
}
项目:mturksdk-java-code-maven    文件:MyHIT.java   
public void appendFilter(Filter filter) {
    service.addFilter(filter);
}
项目:gort-public    文件:MyHIT.java   
public void appendFilter(Filter filter) {
    service.addFilter(filter);
}
项目:java-aws-mturk    文件:AsyncRequest.java   
/**
 * Creates a new asynchronous request
 * 
 * @param msg       The request to send to the requester endpoint
 * @param f         The first filter to invoke
 * @param callback  (Optional) A callback handler to invoke when the work queue processed the request
 */
public AsyncRequest(Message msg, Filter f, AsyncCallback callback) {
  this.message = msg;
  this.firstFilter = f;
  this.cb = callback;
}
项目:java-aws-mturk    文件:FilteredAWSService.java   
/**
 * 
 * @return - List of filters
 */public List<Filter> getFilterList() {
    return filterList;
}
项目:mturksdk-java-code-maven    文件:AsyncRequest.java   
/**
 * Creates a new asynchronous request
 * 
 * @param msg       The request to send to the requester endpoint
 * @param f         The first filter to invoke
 * @param callback  (Optional) A callback handler to invoke when the work queue processed the request
 */
public AsyncRequest(Message msg, Filter f, AsyncCallback callback) {
  this.message = msg;
  this.firstFilter = f;
  this.cb = callback;
}
项目:mturksdk-java-code-maven    文件:FilteredAWSService.java   
/**
 * 
 * @return - List of filters
 */public List<Filter> getFilterList() {
    return filterList;
}