package cmput301.textbookhub.Models;

import java.util.Calendar;

/**
 * Created by Fred on 2016/3/8.
 */
public class Bid implements Comparable, UniqueItem<String>{

    private String id;
    private Double amount;
    private String bidder;
    private String timestamp;

    public Bid(Double amount, User user){
        this.amount = amount;
        this.bidder = user.getName();
        this.timestamp = new Long(Calendar.getInstance().getTimeInMillis()).toString();
        this.id = user.getID() + "_BID_" + this.timestamp;
    }

    public Double getAmount() {

        return amount;
    }

    public String getBidder() {
        return bidder;
    }

    public String getTimestamp() {
        return timestamp;
    }

    @Override
    public int compareTo(Object another) {
        return this.amount.compareTo(((Bid) another).getAmount());
    }

    @Override
    public String toString() {
        return this.amount.toString();
    }

    @Override
    public String getID() {
        return this.id;
    }

    @Override
    public void setID(String id) {
        this.id = id;
    }

}

@@ -63,16 +63,233 @@
 r;%0A%0A/**%0A
+ * %3Ccode%3EBid%3C/code%3E is use to return the bid amount, bidder, bid time made from %3Ccode%3EUser%3C/code%3E on a %3Ccode%3ETextbook%3C/code%3E.%0A * %0A * @author Thirteam%0A * @version 1.1%0A * @since 2016/03/08%0A * @see User%0A * @see Testbook%0A
  * Creat
@@ -485,16 +485,179 @@
 stamp;%0A%0A
+    /**%0A     * Create a new %3Ccode%3EBid%3C/code%3E by the user.%0A     * %0A     * @param amount the amount bidded%0A     * @param user the user bid on the textbook%0A     * */%0A
     publ
@@ -920,128 +920,408 @@
     
-public Double getAmount() %7B%0A%0A        return amount;%0A    %7D%0A%0A    public String getBidder() %7B%0A        return bidder;%0A    %7D%0A
+/**%0A     * Return the amount bidded.%0A     * %0A     * @retrun the bid amount%0A     */%0A    public Double getAmount() %7B%0A%0A        return amount;%0A    %7D%0A%0A    /**%0A     * Return the bidder on the textbook.%0A     * %0A     * @return the textbook bidder%0A     */%0A    public String getBidder() %7B%0A        return bidder;%0A    %7D%0A%0A    /**%0A     * Return the bid time.%0A     * %0A     * @retrun the timestamp of the bid%0A     */
 %0A   

Update Bid.java