public Double getTotalSum() { double sum = 0.0; for (ArticleData data : articles) { sum += Double.valueOf(data.getPrice()); } return sum; }
public boolean removeArticleWithId(String id) { logger.info("Remove article by id: " + id); for (ArticleData article : articles) { if (article.getId().equals(id)) { return remove(article); } } return Boolean.FALSE; }
public boolean remove(ArticleData article) { logger.info("Remove article: " + article.toString()); return articles.remove(article); }
public void addArticleData(ArticleData article) { logger.info("Added article: " + article.toString()); articles.add(article); }