package Auction;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by K_A_Volchica on 16.04.2015.
 */
public class AuctionImpl implements Auction
{
    private Map<String, Integer> content = new HashMap<String, Integer>();

    @Override
    public String toString() {
        return "AuctionImpl{" +
                "content=" + content +
                '}';
    }
    int i=100;

    @Override
    public void placeProduct(String product, BigDecimal initialPrice){

        if (product == null || product.trim().length() == 0) {
            throw new IllegalArgumentException("Product cannot be null");
        }
        if (initialPrice.signum()==0||initialPrice.signum()==-1) {
            throw new IllegalArgumentException("Price should be positive");
        }
        else
        {
            if (i==100)
            {
                i=0;
            }
            else
            {
                i = i + 1;
            }
            content.put(product,i);
            Map<String, BigDecimal> hashid = new HashMap<String, BigDecimal>();
            hashid.put("Admin", initialPrice);
            System.out.println(content);
            System.out.println(hashid);

        }
    }

 /* @Override
    void addBid(String user, String product, BigDecimal price)
    {

    };
/*
    @Override
    void removeBid(String user, String product);

    @Override
    boolean sellProduct(String product);*/
}
