pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.model
Class ShoppingCartPosition

java.lang.Object
  extended by org.torweg.pulse.component.shop.model.ShoppingCartPosition
All Implemented Interfaces:
java.io.Serializable

public class ShoppingCartPosition
extends java.lang.Object
implements java.io.Serializable

A position in the ShoppingCart.

Version:
$Revision: 1522 $
Author:
Christian Schatt
See Also:
Serialized Form

Constructor Summary
ShoppingCartPosition(ShopItem pItem)
          The constructor that sets the ShopItem with an amount of one.
ShoppingCartPosition(ShopItem pItem, int pAmount)
          The constructor that sets the ShopItem and the amount.
 
Method Summary
 int getAmount()
          Returns the amount.
 ShopItem getItem()
          Returns the ShopItem.
 long getPrice(User pUser)
          Returns the total price of the ShoppingCartPosition for the given User.
 Price getPriceObject(User pUser)
          returns the Price for a given User.
 void setAmount(int pAmount)
          Sets the amount.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShoppingCartPosition

public ShoppingCartPosition(ShopItem pItem)
The constructor that sets the ShopItem with an amount of one.

Parameters:
pItem - the ShopItem to be set.

ShoppingCartPosition

public ShoppingCartPosition(ShopItem pItem,
                            int pAmount)
The constructor that sets the ShopItem and the amount.

Parameters:
pItem - the ShopItem to be set.
pAmount - the amount to be set.
Method Detail

getItem

public final ShopItem getItem()
Returns the ShopItem.

Returns:
the ShopItem.

getAmount

public final int getAmount()
Returns the amount.

Returns:
the amount.

setAmount

public final void setAmount(int pAmount)
Sets the amount.

Parameters:
pAmount - the amount to be set.

getPrice

public final long getPrice(User pUser)
Returns the total price of the ShoppingCartPosition for the given User.

Parameters:
pUser - the User to get the price for.
Returns:
the total price of the ShoppingCartPosition for the given User.

getPriceObject

public final Price getPriceObject(User pUser)
returns the Price for a given User.

Parameters:
pUser - the User
Returns:
the price object