From dcca35dd0d1e09db502e83a2ee38ee1167f77781 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 14 Sep 2015 10:40:29 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20added=20method=20isProductType(?= =?utf8?q?)=20-=20changed=20type=20of=20getAll()=20to=20List=20asthis=20is?= =?utf8?q?=20fine=20-=20updated=20jars=20Signed-off-by:Roland=20H=C3=A4der?= =?utf8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcore-ee-logger.jar | Bin 8006 -> 8032 bytes lib/jcoreee.jar | Bin 18214 -> 18445 bytes .../model/basket/AddableBasketItem.java | 7 +++++++ .../jshopcore/model/basket/BaseBasket.java | 19 ++++++++---------- .../jshopcore/model/basket/Basket.java | 4 ++-- .../jshopcore/model/item/BaseItem.java | 6 ++++++ 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/lib/jcore-ee-logger.jar b/lib/jcore-ee-logger.jar index 6d0e98ca34bb9da22fe71b465ba1765a785a8053..9631578315fa23cab8f95f90e90b3013588b16ea 100644 GIT binary patch delta 968 zcmaJ=QAkr!7(Vyj?anPuxit-Tb#6o0Q0{eTZYA^PCOXv8AwBdqm)@a z>do!E1s0TVK@>h^27%#IioN+1U(h?pEF!d!VBm8=l}oj`|p4M^W81=gNjoV zg2jPQ6GCssl?o2w*W*fZ)2*-Q2qC?aNQ+S=oQ^~*&w~O*>~%2nGeivuauH@{xEQmK zxCFDGxiJj+3Yk*Y%paf0+OjRo)A6ru+P^ok!%J6$chZZ% z{^`SID?)U|$$NX0$gQ?DwdJvu-Pb42g~p2~A*r8bW+bWaEzH*}=sl?kj&}=nwIm^2 ze{lWOjK0RdkY`dG<8Mn6=OpDeZ}&-Te*=3Q@SP{(gAMrmfUoIry-nhF!0W2EpS{~4 zKoFs;PC{t4?BNl*GIBL8k4=u&G^Q-(jN?rnm)TK?)$$?;uO_#UBnucA7z!pj#q(R}8N{2J>1O7Y z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V z{@yV5%IldI<(EajHa?8KQJigP0yxB!%n?8t3rxYD5W_4oS>WoKWu@h5Dwu^L07V6} zPz0c;U{(`=O5e{(03n^eH%I`*I(@GZ{voDM5kQq90G+;h0vNcL07wH>Mm&G0W(nwo zDKbzAOX9wDlx-}MUF=oD2I%R|`w|xEIsHw3!~sNNS4!Wt#rCgp8}fMNmtK{_ncB-A zNdZVXR<*H>9FU9})zq3?yIv)xL7>r%l`J?lQgxeE>znJd7{ z4b@*SOkiJNorrV%DuH~i%B3{O|LAkdW3_2vKLQql$mBU-p#$qJbfSyjc^9gElM@HV z_7T0&iHY%v!DUAV4;&dB8=o9JqF>0*YE$jqqz*Vk1&dNV0&B*kI)qy02LOnLdmhQ1lk%LRqs!}=U;s_+rG`5zO zo$8a9@%HmZ(DfR;@4?p}biISb z58tK}b~{q#Kx5uiH_2pxr^X&q$U(Fa@au4j2hv$|<3*mOukz?r-$nA`Od{)k5o`AG zd1()8eX%;bSk*g;l|>pMGxLY#4C9icV=}`6&t)ta0b*vUM##(*L6ff;?mQP-#1Q#$ zM#IKM$bjbxfw4sKT9H7pKnd|Oe@fDkvN=?+7|U;>_%`ju|5v5Mm0VB3#m9dYWgDt{ ztb4Crv5PC;cj)WRzNUKbf(w}ZMN`d`f(h;BA0jFKB;i{4Q_ABL`^tJc4O@zR{w}w` zLgjz%Q5M%JDvQy_hWGRQi9XOY6>@jjGBV|*a7NLC_LyTPwTs%LoBAvCH+>P#vOR6+ z3tCpQrKeUjXW6dKO{ojRXneZ7CClctX-#!U{B5&GYoFuvmbqzO6%+6CK`N{1JFf%( z^IBQ|RlP2Fp!dad;fZ@+@_g$`z4w~dEZd`Y`F1#6jyf!Pyw#thvhm&PIdyN6YSmw* z_s(v z;OnET4E5h~SD&l@Av implements Basket< } @Override - public Map getAll () { + public List getAll () { // Init map - Map map = new LinkedHashMap<>(this.deque.size()); + List list = new LinkedList<>(); // Iterate over full item list for (T item : this.deque) { @@ -83,11 +82,11 @@ public abstract class BaseBasket implements Basket< } // Add to map, use the item's id as key - map.put(item.getItemId(), item); + list.add(item); } // Return it - return map; + return list; } @Override @@ -114,15 +113,13 @@ public abstract class BaseBasket implements Basket< } // Get all items - Map map = this.getAll(); + List list = this.getAll(); // Default is not found boolean isAdded = false; - for (Map.Entry entrySet : map.entrySet()) { - // Get whole item - T i = entrySet.getValue(); - + // Loop through list + for (final T i : list) { // Compare id if (i.equals(item)) { // Okay, found it diff --git a/src/org/mxchange/jshopcore/model/basket/Basket.java b/src/org/mxchange/jshopcore/model/basket/Basket.java index 8e17339..f0824bb 100644 --- a/src/org/mxchange/jshopcore/model/basket/Basket.java +++ b/src/org/mxchange/jshopcore/model/basket/Basket.java @@ -17,7 +17,7 @@ package org.mxchange.jshopcore.model.basket; import java.io.Serializable; -import java.util.Map; +import java.util.List; import org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException; /** @@ -57,7 +57,7 @@ public interface Basket extends Serializable { * * @return Map on all basket items */ - public Map getAll (); + public List getAll (); /** * Getter for last entry diff --git a/src/org/mxchange/jshopcore/model/item/BaseItem.java b/src/org/mxchange/jshopcore/model/item/BaseItem.java index 2015d2d..8e4591e 100644 --- a/src/org/mxchange/jshopcore/model/item/BaseItem.java +++ b/src/org/mxchange/jshopcore/model/item/BaseItem.java @@ -154,4 +154,10 @@ public abstract class BaseItem implements AddableBasketItem, Comparable