Скачиваний:
62
Добавлен:
15.06.2014
Размер:
5.93 Кб
Скачать
package products;

public class BaseProduct {
private String baseproduct_name;
private String baseproduct_arrivaldate;
private String baseproduct_maker;
private String baseproduct_price;
private String baseproduct_type;
private String baseproduct_shelflife;
private String baseproduct_weight;
private String baseproduct_number;
private String baseproduct_country;
private String baseproduct_makeraddress;
private String baseproduct_makersite;
private String baseproduct_makermail;
private String baseproduct_makerphone;
private String baseproduct_department;

//base constructor
public BaseProduct() {
baseproduct_name = "no data";
baseproduct_arrivaldate = "no data";
baseproduct_maker = "no data";
baseproduct_price = "no data";
baseproduct_type = "no data";
baseproduct_shelflife = "no data";
baseproduct_weight = "no data";
baseproduct_number = "no data";
baseproduct_country = "no data";
baseproduct_makeraddress = "no data";
baseproduct_makersite = "no data";
baseproduct_makermail = "no data";
baseproduct_makerphone = "no data";
baseproduct_department = "no data";
}

//constructor
public BaseProduct(BaseProduct baseproduct)
{
baseproduct_name = baseproduct.getBaseProductName();
baseproduct_arrivaldate = baseproduct.getBaseProductArrivalDate();
baseproduct_maker = baseproduct.getBaseProductMaker();
baseproduct_price = baseproduct.getBaseProductPrice();
baseproduct_type = baseproduct.getBaseProductType();
baseproduct_shelflife = baseproduct.getBaseProductShelfLife();
baseproduct_weight = baseproduct.getBaseProductWeight();
baseproduct_number = baseproduct.getBaseProductNumber();
baseproduct_country = baseproduct.getBaseProductCountry();
baseproduct_makeraddress = baseproduct.getBaseProductMakerAddress();
baseproduct_makersite = baseproduct.getBaseProductMakerSite();
baseproduct_makermail = baseproduct.getBaseProductMakerMail();
baseproduct_makerphone = baseproduct.getBaseProductMakerPhone();
baseproduct_department = baseproduct.getBaseProductDepartment();
}

//get methods
public String getBaseProductName()
{
return baseproduct_name;
}

public String getBaseProductArrivalDate()
{
return baseproduct_arrivaldate;
}

public String getBaseProductMaker()
{
return baseproduct_maker;
}

public String getBaseProductPrice()
{
return baseproduct_price;
}

public String getBaseProductType()
{
return baseproduct_type;
}

public String getBaseProductShelfLife()
{
return baseproduct_shelflife;
}

public String getBaseProductWeight()
{
return baseproduct_weight;
}

public String getBaseProductNumber()
{
return baseproduct_number;
}

public String getBaseProductCountry()
{
return baseproduct_country;
}

public String getBaseProductMakerAddress()
{
return baseproduct_makeraddress;
}

public String getBaseProductMakerSite()
{
return baseproduct_makersite;
}

public String getBaseProductMakerMail()
{
return baseproduct_makermail;
}

public String getBaseProductMakerPhone()
{
return baseproduct_makerphone;
}

public String getBaseProductDepartment() {
return baseproduct_department;
}

//set methods
public void setBaseProductName(String name)
{
baseproduct_name = name;
}

public void setBaseProductArrivalDate(String arrivaldate)
{
baseproduct_arrivaldate = arrivaldate;
}

public void setBaseProductMaker(String maker)
{
baseproduct_maker = maker;
}

public void setBaseProductPrice(String price)
{
baseproduct_price = price;
}

public void setBaseProductType(String type)
{
baseproduct_type = type;
}

public void setBaseProductShelfLife(String shelflife)
{
baseproduct_shelflife = shelflife;
}

public void setBaseProductWeight(String weight)
{
baseproduct_weight = weight;
}

public void setBaseProductNumber(String number)
{
baseproduct_number = number;
}

public void setBaseProductCountry(String country)
{
baseproduct_country = country;
}

public void setBaseProductMakerAddress(String makeraddress)
{
baseproduct_makeraddress = makeraddress;
}

public void setBaseProductMakerSite(String makersite) {
baseproduct_makersite = makersite;
}

public void setBaseProductMakerMail(String makermail) {
baseproduct_makermail = makermail;
}

public void setBaseProductMakerPhone(String makerphone) {
baseproduct_makerphone = makerphone;
}

public void setBaseProductDepartment(String department) {
baseproduct_department = department;
}

//method for showing into console information
public void showInConsole() {
System.out.println(baseproduct_name);
System.out.println(baseproduct_arrivaldate);
System.out.println(baseproduct_maker);
System.out.println(baseproduct_price);
System.out.println(baseproduct_type);
System.out.println(baseproduct_shelflife);
System.out.println(baseproduct_weight);
System.out.println(baseproduct_number);
System.out.println(baseproduct_country);
System.out.println(baseproduct_makeraddress);
System.out.println(baseproduct_makersite);
System.out.println(baseproduct_makermail);
System.out.println(baseproduct_makerphone);
System.out.println(baseproduct_department);
}

boolean isEmpty() {
if(baseproduct_name == "" || baseproduct_arrivaldate == "" || baseproduct_maker == ""
|| baseproduct_price == "" || baseproduct_type == "" || baseproduct_shelflife == ""
|| baseproduct_weight == "" || baseproduct_number == "" || baseproduct_country == "" || baseproduct_makeraddress == ""
|| baseproduct_makersite == "" || baseproduct_makermail == "" || baseproduct_makerphone == ""
|| baseproduct_department == "") {
return true;
}
else {
return false;
}
}
}
Соседние файлы в папке products