return recalculate(null);
}
private PricingProcessorResult recalculate(Map<Long, CalculationPriceSetItemDto> existingTypeIdToCalculationPriceSetItemMap) {
Long quantity = Long.valueOf(editableCalculation.getQuantityTextBox().getText());
PricingProcessorResult pricingProcessorResult = pricingProcessor.process(quantity, calculationTree, existingTypeIdToCalculationPriceSetItemMap);
for (Map.Entry<String, ComputableCalculationItem> mapEntry : pathNodesStringToComputableCalculationItemMap.entrySet()) {
ComputableCalculationItem computableCalculationItem = mapEntry.getValue();
computableCalculationItem.recalculate();
}
for (Map.Entry<Long, CalculationPriceSetItemDto> mapEntry : pricingProcessorResult.getTypeIdToCalculationPriceSetItemMap().entrySet()) {
CalculationPriceSetItemDto calculationPriceSetItemDto = mapEntry.getValue();
ComputableCalculationPriceSetItem computableCalculationPriceSetItem = typeIdToComputableCalculationPriceSetItemMap.get(mapEntry.getKey());
computableCalculationPriceSetItem.setCalculationPriceSetItem(calculationPriceSetItemDto);
computableCalculationPriceSetItem.recalculate();
}
computableCalculation.getCalculation().setPrice(pricingProcessorResult.getTotalPrice());
computableCalculation.recalculate(calculator);
return pricingProcessorResult;
}