001package scpc.model;
002
003import java.io.Serializable;
004
005/**
006 * 購物車裡的項目<br>
007 * Present a Shopping cart item.
008 *
009 * @author Knet Yeh
010 * @param <T> type of real cart item.
011 */
012public interface IItem<T> {
013
014    /**
015     * 購物車品項識別,例如 產品代號
016     *
017     * @return cart item's identity,e.g. product code
018     */
019    public Serializable getIdentity();
020
021    /**
022     * 購物車品項的真實類別
023     *
024     * @return type of real cart item
025     */
026    public T as();
027
028    /**
029     * 品項的數量
030     *
031     * @return the quantity of the item.
032     */
033    public long getQuantity();
034
035    /**
036     * 設定品項數量
037     *
038     * @param quantity of item
039     */
040    public void setQuantity(long quantity);
041
042    /**
043     * 售價
044     *
045     * @return sale price of item.
046     */
047    public double getSalePrice();
048
049    /**
050     * 原價
051     *
052     * @return regular price of item.
053     */
054    public double getRegularPrice();
055
056}