Скачиваний:
17
Добавлен:
01.05.2014
Размер:
2 Кб
Скачать
package ic.core;
/*
 * Funiture.java
 *
 * Created on April 20, 2007, 2:01 AM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author adm
 */
public class Furniture {

    String seller = "Wood and drill Inc.";
    String name="Wooden 1";
    float price = 0;
    
    public static final float M_LOW_COST = 300;
    public static final float M_MEDIUM_COST = 700;
    public static final float M_HIGH_COST = 1100;
    
    public  enum Beauty {
        low,
        medium,
        high
    }
    
    private Beauty beauty;
    
     public void setName(String name) {
        this.name = name;
    }
       
    public String getName() {
        return name;
    }
    
    public String getSeller() {
        return this.seller;
    }
    
    public void setSeller(String s) {
        this.seller = s ;
    }
    
    public float getPrice() {
        return this.price;
    }
    
    public void setPrice(float s) {
        this.price = s ;
    }
    
    public Furniture() {
        beauty = Beauty.low;
    }
    
    public Furniture(Beauty b) {
        beauty = b;
    }
    
    public Beauty getBeauty() {
        return beauty;
    }    
    
    public float getCost() {
        switch(beauty) {
            case low:
                return M_LOW_COST;
            case medium:
                return M_MEDIUM_COST;
            case high:
                return M_HIGH_COST;
            default:
                return -1;
        }
    }
}
Соседние файлы в папке core