package blade.business;
import java.text.NumberFormat;
//This is the superclass.
//Subclasses include Survival, Weapon, Yardwork, Kitchen, and Workshop.
//Later on, we will also add a ShoppingCart class.
public class Blade {
private String name;
private int modelNumber;
private String bladeColor;
private String powerType;//electric, gas, battery, hand
private double price;
private String bladeType;//circular, sword, knife, chained, [don't forget boolean diamondBladed]
private String brand;
//[Survival: MTECH_USA, TAC_Force]
//[Weapon: Cold_Steel, BladesUSA]
//[Yardwork: Greenworks, Remington]
//[Kitchen: Chicago_Cutlery, Henckels]
//[Workshop: Craftsman, DEWALT]
private int length;
private String description;//override possibly needed "this diamond blade designed to sever solid wood as well as vines!"
//default constructor
public Blade() {
name = "";
modelNumber = 0;
bladeColor = "";
powerType = "";
price = 0.0;
bladeType = "";
brand = "";
length = 0;
description = "";
}
//overload constructor
public Blade(String name, int modelNumber, String bladeColor, String powerType, double price,
String bladeType, String brand, int length, String description) {
System.out.println("Creating a blade object.");
this.name = name;
this.modelNumber = modelNumber;
this.bladeColor = bladeColor;
this.powerType = powerType;
this.price = price;
this.bladeType = bladeType;
this.brand = brand;
this.length = length;
this.description = description;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setModelNumber(int modelNumber) {
this.modelNumber = modelNumber;
}
public int getModelNumber() {
return modelNumber;
}
public void setBladeColor(String bladeColor) {
this.bladeColor = bladeColor;
}
public String getBladeColor() {
return bladeColor;
}
public void setPowerType(String powerType) {
this.powerType = powerType;
}
public String getPowerType() {
return powerType;
}
public void setPrice(double price) {
this.price = price;
}
public double getPrice() {
return price;
}
public void setBladeType(String bladeType) {
this.bladeType = bladeType;
}
public String getBladeType() {
return bladeType;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getBrand() {
return brand;
}
public void setBladeLength(int length) {
this.length = length;
}
public int getBladeLength() {
return length;
}
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
public String getValueFormatted() {
NumberFormat currency = NumberFormat.getCurrencyInstance();
String valueFormatted = currency.format(price);
return valueFormatted;
}
//Since the purpose of a bladed device may change (i.e. a chainsaw designed for murdering
//instead of yardwork), we should provide override methods just in case:
@Override
public String toString() {
return description;
}
}