Ejemplo n.º 1
0
 public Double getTotalSum() {
   double sum = 0.0;
   for (ArticleData data : articles) {
     sum += Double.valueOf(data.getPrice());
   }
   return sum;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public boolean remove(ArticleData article) {
   logger.info("Remove article: " + article.toString());
   return articles.remove(article);
 }
Ejemplo n.º 4
0
 public void addArticleData(ArticleData article) {
   logger.info("Added article: " + article.toString());
   articles.add(article);
 }