Examples of Results


Examples of com.assaydepot.result.Results

      urlBuilder.append( "&access_token=" ).append( conf.getApiToken() );
    }

    JsonNode rootNode = doParseURL( urlBuilder.toString() );   

    Results results = new Results();

    results.setTotal( rootNode.path( "total" ).getIntValue() );
    results.setPage( rootNode.path( "page" ).getIntValue() );
    results.setPerPage( rootNode.path( "per_page" ).getIntValue() );
    results.setQueryTime( rootNode.path( "query_time" ).getDoubleValue() );
    results.setFacets( doFacets( rootNode.path( "facets" )));
    results.setProviderRefs( doProviderRefs( rootNode.path( "provider_refs" )));
   
    return results;
  }
View Full Code Here

Examples of com.google.checkout.Results

  public static final BigDecimal DEFAULT_SHIPPING = new BigDecimal("0.00");
  public static final String DOT_DEFAULT = ".default";

  public MerchantCalculationResults performCalculation(MerchantCalculationCallback _callback) throws CalculationException {
    MerchantCalculationResults mcResults = new MerchantCalculationResults();
    Results results = new Results();
    mcResults.setResults(results);
    boolean calcTax = _callback.getCalculate().getTax();
    boolean calcShipping = false;
    if (_callback.getCalculate().getShipping() != null) {
      calcShipping = true;
    }
    BigDecimal orderTotal = calculateOrderTotal(_callback.getShoppingCart().getItems());
    if (LOG.isDebugEnabled()) {
      LOG.debug("Order Total is [" + orderTotal + "]");
    }
    BigDecimal defaultTax = JavaCommerce.getConfiguration().getBigDecimal(CONFIG_GOOGLE_CALC_TAX_DEFAULT, DEFAULT_TAX);
    BigDecimal defaultShipping = JavaCommerce.getConfiguration().getBigDecimal(CONFIG_GOOGLE_CALC_SHIPPING_DEFAULT, DEFAULT_SHIPPING);
   
    // Addresses is always passed according to the XSD.
    for (int i = 0; i < _callback.getCalculate().getAddresses().getAnonymousAddressCount(); i++) {
      AnonymousAddress address = _callback.getCalculate().getAddresses().getAnonymousAddress(i);
      TotalTax totalTax = null;
      if (calcTax) {
        // Get the tax rate
        BigDecimal taxRate = JavaCommerce.getConfiguration().getBigDecimal(new StringBuffer(CONFIG_GOOGLE_CALC_TAX).append(".").append(address.getRegion()).toString(), defaultTax);
        // Calculate Tax
        BigDecimal tax = taxRate.multiply(orderTotal);
        tax = tax.setScale(2, BigDecimal.ROUND_UP);
        if (LOG.isDebugEnabled()) {
          LOG.debug("Calculated tax of [" + tax + "] with rate of [" + taxRate + "]");
        }
        totalTax = new TotalTax();
        totalTax.setContent(tax);
        totalTax.setCurrency(DEFAULT_CURRENCY);
      }
      if (calcShipping) {
        for (int j = 0; j < _callback.getCalculate().getShipping().getMethodCount(); j++) {
          Result result = new Result();
          result.setAddressId(address.getId());
          result.setShippable(true);
          Method method = _callback.getCalculate().getShipping().getMethod(j);
          result.setShippingName(method.getName());
          // Load Shipping, read order:
          // 1. google.calculation.shipping.{method name}.{address region}
          // 2. google.calculation.shipping.{method name}.default
          // 3. google.calculation.shipping.default
          BigDecimal shipping = JavaCommerce.getConfiguration().getBigDecimal(new StringBuffer(CONFIG_GOOGLE_CALC_SHIPPING).append(".").append(method.getName()).append(".").append(address.getRegion()).toString(), JavaCommerce.getConfiguration().getBigDecimal(new StringBuffer(CONFIG_GOOGLE_CALC_SHIPPING).append(".").append(method.getName()).append(DOT_DEFAULT).toString(), defaultShipping));
          shipping = shipping.setScale(2, BigDecimal.ROUND_UP);
          if (LOG.isDebugEnabled()) {
            LOG.debug("Calculated shipping of [" + shipping + "] for [" + method.getName() + "]");
          }
          ShippingRate rate = new ShippingRate();
          rate.setContent(shipping);
          rate.setCurrency(DEFAULT_CURRENCY);
          result.setShippingRate(rate);
          if (calcTax) {
            result.setTotalTax(totalTax);
          }
          results.addResult(result);
        }
      }
      else if (calcTax) {
        Result result = new Result();
        result.setAddressId(address.getId());
        result.setTotalTax(totalTax);
        results.addResult(result);
      }
    }
    return mcResults;
  }
View Full Code Here

Examples of com.google.checkout.schema._2.MerchantCalculationResults.Results

    individualResult.setShippable(isShippable);
    individualResult.setShippingRate(createMoney(shippingRate));
    individualResult.setTotalTax(createMoney(totalTaxAmount));
    individualResult.setMerchantCodeResults(merchantCodeResults);
   
    Results results = _objectFact.createMerchantCalculationResultsResults();
    results.getResult().add(individualResult);
    MerchantCalculationResults mResults
        = _objectFact.createMerchantCalculationResults();
    mResults.setResults(results);
    JAXBElement elem = _objectFact.createMerchantCalculationResults(mResults);
    return convertToDOM(elem);
View Full Code Here

Examples of com.lewisd.maven.lint.Results

  }

  @Override
  public void marshal(Object source, HierarchicalStreamWriter writer,
      MarshallingContext context) {
    Results results = (Results) source;
   
    final String status;
    if (results.getViolations().isEmpty()) {
      status = "PASS";
    } else {
      status = "FAIL";
    }
    writer.addAttribute("status", status);
    writer.addAttribute("violations", Integer.toString(results.getViolations().size()));
   
    for (Violation violation : results.getViolations()) {
      context.convertAnother(violation);
    }
  }
View Full Code Here

Examples of com.packtpub.java7.concurrency.chapter3.recipe4.utils.Results

    final int PARTICIPANTS=5;
    final int LINES_PARTICIPANT=2000;
    MatrixMock mock=new MatrixMock(ROWS, NUMBERS,SEARCH);
   
    // Initializes the object for the results
    Results results=new Results(ROWS);
   
    // Creates an Grouper object
    Grouper grouper=new Grouper(results);
   
    // Creates the CyclicBarrier object. It has 5 participants and, when
View Full Code Here

Examples of com.zappos.model.JsonObj.Results

    Iterator<Results> itr = obj.getResults().iterator();
    HashSet<Results> hs = new HashSet<Results>();

    //This loop generates a list of products without any duplicates.
    while(itr.hasNext()){
      Results temp = itr.next();
      if(hs.contains(temp)){
        System.out.println("Has...");       
      }
      else {
        list.add(temp);
View Full Code Here

Examples of jp.freeex.us.fourtypes.shared.Results

   */
  @Override
  public void execute() {
    long elapse = System.currentTimeMillis();
    log.info("[ResultsCronService#execute()] start");
    Results results = StatisticsManager.getInstance().getResults();
    if(results==null||results.size()<=0){
      log.info("[ResultsCronService#execute()] no-results/end: " +
          (System.currentTimeMillis() - elapse) + "mSec.");
      return;
    }
    List<Result> resultList = results.getResultList();
    PersistenceManagerFactory pmf = PMF.get();
    PersistenceManager pm = null;
    try{
      pm = pmf.getPersistenceManager();
      Transaction tx = pm.currentTransaction();
View Full Code Here

Examples of jp.freeex.us.fourtypes.shared.Results

    props.put("name", C_NAME);
    try{
      CacheFactory cFac = cMan.getCacheFactory();
      Cache cache = cFac.createCache(props);
      cMan.registerCache(C_NAME, cache);
      cache.put(C_KEY_RESULTS, new Results());
      cache.put(C_KEY_SUMMARY, retrieveSummary());
    }catch(CacheException e){
     
    }
  }
View Full Code Here

Examples of jp.freeex.us.fourtypes.shared.Results

    log.info("[StatisticsManager#setResult()] count up summary: " +
        summary.toString());
    cache.put(C_KEY_SUMMARY, summary);

    // 結果キャッシュを更新
    Results results =
        (Results) cache.get(C_KEY_RESULTS);
    log.info("[StatisticsManager#setResult()] got results from cache: " +
        results);
    if(results == null){
      results = new Results();
      log.info("[StatisticsManager#setResult()] results(cache) is null " +
          "/create new result: " + results.toString());
    }
    results.add(x, y, evaluatedAt);
    log.info("[StatisticsManager#setResult()] count up results: " +
        results.toString());
    cache.put(C_KEY_RESULTS, results);
    log.info("[StatisticsManager#setResult()] update result cache:" +
        results.toString());
    log.info("[StatisticsManager#setResult()] end" +
        (System.currentTimeMillis() - elapse) + "mSec.");
  }
View Full Code Here

Examples of jp.freeex.us.fourtypes.shared.Results

    long elapse = System.currentTimeMillis();
    log.info("[StatisticsManager#getResults()] start");
    // キャッシュ上のすべての結果をリストへ移動
    Cache cache =
        CacheManager.getInstance().getCache(C_NAME);
    Results results =
          (Results) cache.get(C_KEY_RESULTS);
    if(results==null){
      results = new Results();
    }
    log.info("[StatisticsManager#getResults()] end: " +
        (System.currentTimeMillis() - elapse) + "mSec.");
    return results;
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.