alWantedQty.add(il.getQuantity());
}
}
HashMap<Item, ItemStatLine> hm = new HashMap<Item, ItemStatLine>();
for (Item item : hmSalePrice.keySet()) {
ItemStatLine isl = hm.get(item);
if (isl == null) {
isl = new ItemStatLine();
isl.setItem(item);
hm.put(item, isl);
}
ArrayList<Long> alPrice = hmSalePrice.get(item);
ArrayList<Long> alQty = hmSaleQty.get(item);
isl.setMeanSalePrice(PricelistsTools.mean(alPrice, alQty));
isl.setMeanSaleQuantity(PricelistsTools.mean(alQty, null));
isl.setSalePriceStdDev(PricelistsTools.standardDeviation(alPrice, alQty, isl.getMeanSalePrice()));
isl.setTotalSaleQuantity(PricelistsTools.sum(alQty));
isl.setSaleQuantityStdDev(PricelistsTools.standardDeviation(alQty, null, isl.getMeanSaleQuantity()));
}
for (Item item : hmWantedPrice.keySet()) {
ItemStatLine isl = hm.get(item);
if (isl == null) {
isl = new ItemStatLine();
isl.setItem(item);
hm.put(item, isl);
}
ArrayList<Long> alPrice = hmWantedPrice.get(item);
ArrayList<Long> alQty = hmWantedQty.get(item);
isl.setMeanWantedPrice(PricelistsTools.mean(alPrice, alQty));
isl.setMeanWantedQuantity(PricelistsTools.mean(alQty, null));
isl.setWantedPriceStdDev(PricelistsTools.standardDeviation(alPrice, alQty, isl.getMeanWantedPrice()));
isl.setTotalWantedQuantity(PricelistsTools.sum(alQty));
isl.setWantedQuantityStdDev(PricelistsTools.standardDeviation(alQty, null, isl.getMeanWantedQuantity()));
}
hmSalePrice.clear();
hmSaleQty.clear();
hmWantedPrice.clear();
hmWantedQty.clear();