Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Курсовая работа / InternetConnection / src / ic / core / Computer
.java /*
* Computer.java
*
* Created on April 20, 2007, 1:21 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package ic.core;
/**
*
* @author adm
*/
public class Computer {
public static final float M_LOW_COST = 500;
public static final float M_MEDIUM_COST = 1000;
public static final float M_HIGH_COST = 2000;
String seller = "Computer house inc.";
String name="IBM PC compatible";
float price = 0;
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 enum Productivity {
low,
medium,
high
}
private Productivity prod;
public Productivity getProductivity() {
return prod;
}
public Computer() {
prod = Productivity.low;
}
public Computer(Productivity p) {
prod = p;
}
public Productivity peformance() {
return prod;
}
public float getCostType() {
switch(prod) {
case low:
return M_LOW_COST;
case medium:
return M_MEDIUM_COST;
case high:
return M_HIGH_COST;
default:
return -1;
}
}
// Software Equipment
SoftwarePackage sp = null;
public boolean setSoftwarePackage(SoftwarePackage sp) {
this.sp = sp;
return true;
}
public SoftwarePackage getSoftwarePackage() {
return sp;
}
}
* Computer.java
*
* Created on April 20, 2007, 1:21 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package ic.core;
/**
*
* @author adm
*/
public class Computer {
public static final float M_LOW_COST = 500;
public static final float M_MEDIUM_COST = 1000;
public static final float M_HIGH_COST = 2000;
String seller = "Computer house inc.";
String name="IBM PC compatible";
float price = 0;
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 enum Productivity {
low,
medium,
high
}
private Productivity prod;
public Productivity getProductivity() {
return prod;
}
public Computer() {
prod = Productivity.low;
}
public Computer(Productivity p) {
prod = p;
}
public Productivity peformance() {
return prod;
}
public float getCostType() {
switch(prod) {
case low:
return M_LOW_COST;
case medium:
return M_MEDIUM_COST;
case high:
return M_HIGH_COST;
default:
return -1;
}
}
// Software Equipment
SoftwarePackage sp = null;
public boolean setSoftwarePackage(SoftwarePackage sp) {
this.sp = sp;
return true;
}
public SoftwarePackage getSoftwarePackage() {
return sp;
}
}
Соседние файлы в папке core