X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Forg%2Fmxchange%2Fjshopcore%2Fmodel%2Fbasket%2FBasket.java;h=d2e9c08baebe13d7ffd6758658242aaf52cda2f9;hb=0d0ea908adc6bf06fb5d31da958594050d107c25;hp=8e173391725b00d9d6438df7b55aa64922f7cbbc;hpb=73b901e9d9e1638a493040c23f986df950b75d5d;p=jcustomer-core.git diff --git a/src/org/mxchange/jshopcore/model/basket/Basket.java b/src/org/mxchange/jshopcore/model/basket/Basket.java index 8e17339..d2e9c08 100644 --- a/src/org/mxchange/jshopcore/model/basket/Basket.java +++ b/src/org/mxchange/jshopcore/model/basket/Basket.java @@ -17,12 +17,12 @@ package org.mxchange.jshopcore.model.basket; import java.io.Serializable; -import java.util.Map; +import java.util.List; import org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException; /** * An interface for baskets - * + *

* @author Roland Haeder * @param Any addable basket items */ @@ -30,46 +30,54 @@ public interface Basket extends Serializable { /** * Adds given item instance to this basket - * + *

* @param item Item instance to add - * @throws org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException If the item instance has already been added + *

+ * @throws org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException + * If the item instance has already been added */ - public void addItem (final T item) throws BasketItemAlreadyAddedException; + void addItem (final T item) throws BasketItemAlreadyAddedException; /** - * Checks whether the given item has already been added by checking the - * item's id. - * - * @param item Item instance to check - * @return Whether the given item has been found + * Clears the basket instance */ - public boolean isAdded (final T item); - - /** - * Checks if the basket is empty - * - * @return Whether the basket is empty - */ - public boolean isEmpty (); + void clear (); /** * Some "getter" for all entries in this basket - * + *

* @return Map on all basket items */ - public Map getAll (); + List getAll (); /** * Getter for last entry - * + *

* @return Last added item in basket */ - public T getLast (); + T getLast (); /** * Getter for last num rows - * + *

* @return Last num rows */ - public int getLastNumRows (); + int getLastNumRows (); + + /** + * Checks whether the given item has already been added by checking the + * item's id. + *

+ * @param item Item instance to check + *

+ * @return Whether the given item has been found + */ + boolean isAdded (final T item); + + /** + * Checks if the basket is empty + *

+ * @return Whether the basket is empty + */ + boolean isEmpty (); }