]> git.mxchange.org Git - jcustomer-core.git/blobdiff - src/org/mxchange/jshopcore/model/basket/Basket.java
Cleanup through inspection + updated jar(s)
[jcustomer-core.git] / src / org / mxchange / jshopcore / model / basket / Basket.java
index 8e173391725b00d9d6438df7b55aa64922f7cbbc..d2e9c08baebe13d7ffd6758658242aaf52cda2f9 100644 (file)
 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
- *
+ * <p>
  * @author Roland Haeder<roland@mxchange.org>
  * @param <T> Any addable basket items
  */
@@ -30,46 +30,54 @@ public interface Basket<T extends AddableBasketItem> extends Serializable {
 
        /**
         * Adds given item instance to this basket
-        * 
+        * <p>
         * @param item Item instance to add
-        * @throws org.mxchange.jshopcore.exceptions.BasketItemAlreadyAddedException If the item instance has already been added
+        * <p>
+        * @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
-        *
+        * <p>
         * @return Map on all basket items
         */
-       public Map<Long, T> getAll ();
+       List<T> getAll ();
 
        /**
         * Getter for last entry
-        *
+        * <p>
         * @return Last added item in basket
         */
-       public T getLast ();
+       T getLast ();
 
        /**
         * Getter for last num rows
-        * 
+        * <p>
         * @return Last num rows
         */
-       public int getLastNumRows ();
+       int getLastNumRows ();
+
+       /**
+        * Checks whether the given item has already been added by checking the
+        * item's id.
+        * <p>
+        * @param item Item instance to check
+        * <p>
+        * @return Whether the given item has been found
+        */
+       boolean isAdded (final T item);
+
+       /**
+        * Checks if the basket is empty
+        * <p>
+        * @return Whether the basket is empty
+        */
+       boolean isEmpty ();
 }