org.paneris.melati.shopping
Class ShoppingTrolleyItem

java.lang.Object
  extended by org.paneris.melati.shopping.ShoppingTrolleyItem
Direct Known Subclasses:
DefaultShoppingTrolleyItem

public abstract class ShoppingTrolleyItem
extends java.lang.Object

Extend this to create your own ShoppingTrolleyItem.


Field Summary
protected  java.lang.String description
           
protected  java.lang.Integer id
           
protected  java.util.Locale locale
           
 org.melati.Melati melati
           
protected  double price
           
protected  double quantity
           
protected  ShoppingTrolley trolley
           
 
Constructor Summary
ShoppingTrolleyItem()
           
 
Method Summary
 java.lang.String displayCurrency(double value)
          format a number in the locale currency.
 java.lang.String getDeliveryDisplay()
          Display the cost of delivery.
abstract  double getDeliveryValue()
          Work out the cost of delivery.
 java.lang.String getDescription()
          The description.
 java.lang.Integer getId()
          The id.
 double getPrice()
          The price of this item.
 java.lang.String getPriceDisplay()
          Display the price of this item.
 double getQuantity()
          The quantity on the trolley.
 java.lang.String getQuantityDisplay()
          Get the quantity on the trolley formatted for display.
 double getTotalValue()
          Calculate the value (without delivery).
 java.lang.String getTotalValueDisplay()
          Display the item value.
 double getValue()
          Calculate the value (without delivery).
 java.lang.String getValueDisplay()
          Display the item value.
 void initialise(ShoppingTrolley trolleyIn, org.melati.Melati melatiIn, java.lang.Integer idIn, java.lang.String descriptionIn, java.lang.Double priceIn)
          Public Constructor to build a trolley item from some id.
protected abstract  void load(java.lang.Integer idIn)
          Load in information about this product given an id.
static ShoppingTrolleyItem newTrolleyItem(MelatiShoppingConfig config)
           
 void setPrice(double p)
          Set the price of this item.
 void setQuantity(double q)
          Set the quantity on the trolley.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.Integer id

quantity

protected double quantity

price

protected double price

locale

protected java.util.Locale locale

description

protected java.lang.String description

trolley

protected ShoppingTrolley trolley

melati

public org.melati.Melati melati
Constructor Detail

ShoppingTrolleyItem

public ShoppingTrolleyItem()
Method Detail

newTrolleyItem

public static ShoppingTrolleyItem newTrolleyItem(MelatiShoppingConfig config)
                                          throws org.melati.util.InstantiationPropertyException
Throws:
org.melati.util.InstantiationPropertyException

initialise

public void initialise(ShoppingTrolley trolleyIn,
                       org.melati.Melati melatiIn,
                       java.lang.Integer idIn,
                       java.lang.String descriptionIn,
                       java.lang.Double priceIn)
Public Constructor to build a trolley item from some id.


load

protected abstract void load(java.lang.Integer idIn)
Load in information about this product given an id. Perhaps this id represents a poem troid?


getId

public java.lang.Integer getId()
The id.


getDescription

public java.lang.String getDescription()
The description.


getQuantity

public double getQuantity()
The quantity on the trolley.


setQuantity

public void setQuantity(double q)
Set the quantity on the trolley.


getQuantityDisplay

public java.lang.String getQuantityDisplay()
Get the quantity on the trolley formatted for display. If it is an iteger, display it as such.


getPrice

public double getPrice()
The price of this item.


setPrice

public void setPrice(double p)
Set the price of this item.


getPriceDisplay

public java.lang.String getPriceDisplay()
Display the price of this item.


getDeliveryValue

public abstract double getDeliveryValue()
Work out the cost of delivery.


getDeliveryDisplay

public java.lang.String getDeliveryDisplay()
Display the cost of delivery.


getValue

public double getValue()
Calculate the value (without delivery).


getValueDisplay

public java.lang.String getValueDisplay()
Display the item value.


getTotalValue

public double getTotalValue()
Calculate the value (without delivery).


getTotalValueDisplay

public java.lang.String getTotalValueDisplay()
Display the item value.


displayCurrency

public java.lang.String displayCurrency(double value)
format a number in the locale currency.



Copyright © 1997-2009 PanEris. All Rights Reserved.