com.mypos.myposcheckout.ipc

 

Class Cart

java.lang.Object com.mypos.myposcheckout.ipc.Cart


public class Cart
extends java.lang.Object
Purchase cart object.

 

Constructor Summary

Constructors
Constructor and Description
Cart() 

 

Method Summary

All MethodsInstance MethodsConcrete Methods
Modifier and Type Method and Description
void addItem(CartItem newItem) 
java.util.ArrayList<CartItem> getCartItems() 
int getItemsCount() 
java.math.BigDecimal getTotal()
Calculate the total price for all items in the cart.
boolean validate()
Validate cart items.

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Cart

public Cart()

 

Method Detail

addItem

public void addItem(CartItem newItem)

getCartItems

public java.util.ArrayList<CartItem> getCartItems()

getTotal

public java.math.BigDecimal getTotal()
Calculate the total price for all items in the cart.
Returns:
the total cart price

getItemsCount

public int getItemsCount()

validate

public boolean validate()
                 throws IPCException
Validate cart items.
Returns:
true if the cart has items
Throws:
IPCException - if there are no items in the cart