Ejemplo n.º 1
0
 private void clear(Pricing pricing) {
   // Memory
   SplashUpdater.setSubProgress(100);
   this.updateTask = null;
   this.typeIDs.clear();
   this.priceDataList.clear();
   this.failed.clear();
   pricing.removePricingListener(this);
 }
Ejemplo n.º 2
0
 private void createPriceData(final int typeID, final Pricing pricing) {
   PriceData priceData = priceDataList.get(typeID);
   if (priceData == null) {
     priceData = new PriceData();
     priceDataList.put(typeID, priceData);
   }
   boolean ok = false;
   for (PriceMode priceMode : PriceMode.values()) {
     PricingType pricingType = priceMode.getPricingType();
     PricingNumber pricingNumber = priceMode.getPricingNumber();
     if (pricingNumber == null || pricingType == null) {
       continue; // Ignore calculated prices - f.ex. PriceMode.PRICE_MIDPOINT
     }
     Double price = pricing.getPrice(typeID, pricingType, pricingNumber);
     if (price != null) {
       ok = true; // Something is set
       PriceMode.setDefaultPrice(priceData, priceMode, price);
     }
   }
   if (ok) {
     getQueue().remove(typeID); // Load price...
     okay.add(typeID);
     failed.remove(typeID);
   } else {
     failed.add(typeID);
   }
   long nextUpdateTemp = pricing.getNextUpdateTime(typeID);
   if (nextUpdateTemp >= 0 && nextUpdateTemp > nextUpdate) {
     nextUpdate = nextUpdateTemp;
   }
   if (updateTask != null) {
     updateTask.setTaskProgress(typeIDs.size(), okay.size(), 0, 100);
   }
   if (!okay.isEmpty() && !typeIDs.isEmpty()) {
     SplashUpdater.setSubProgress((int) (okay.size() * 100.0 / typeIDs.size()));
   }
 }