Проект разрабатывался в среде IDE NetBeans
В заключение хочу сказать, что благодаря выполнению данной работы я закрепил полученные мной знания синтаксиса языка, а так же способы многопоточной обработки данных.
public class Address implements Serializable{
private int _id;
private String _country;
private String _region;
private String _city;
private String _street;
private String _home;
public Address(String country, String region, String city, String street, String home, int id){
_country = country;
_region = region;
_city = city;
_street =street;
_home = home;
_id = id;
}
public void setCountry(String country){
_country = country;
}
public void setRegion(String region){
_region = region;
}
public void setCity(String city){
_city = city;
}
public void setStreet(String street){
_street = street;
}
public void setHome(String home){
_home = home;
}
public void setID(int id){
_id = id;
}
public String getCountry(){
return this._country;
}
public String getRegion(){
return this._region;
}
public String getCity(){
return this._city;
}
public String getStreet(){
return this._street;
}
public String getHome(){
return this._home;
}
public int getID(){
return this._id;
}
}
public class AddressManager implements Serializable{
public ArrayList<Address> _addresses;
/** delete */
int last_id = 0;
public int getLastID(){
return last_id;
}
public AddressManager(){
_addresses = new ArrayList<Address>();
}
public void Add(String country, String region, String city, String street, String home){
_addresses.add(new Address(country, region, city, street, home, last_id));
last_id++;
}
public String getCountry(int index){
return this._addresses.get(index).getCountry();
}
public String getRegion(int index){
return this._addresses.get(index).getRegion();
}
public String getCity(int index){
return this._addresses.get(index).getCity();
}
public String getStreet(int index){
return this._addresses.get(index).getStreet();
}
public String getHome(int index){
return this._addresses.get(index).getHome();
}
public int getID(int index){
return this._addresses.get(index).getID();
}
public int getIndexByID(int id){
for(int i = 0; i < _addresses.size(); i++){
if(_addresses.get(i).getID() == id){
return i;
}
}
return -1;
}
}
public class Beverage implements Serializable{
private int _id;
private int _makerID;
private int _supplierID;
private int _warehouseID;
/** The name of the drink */
private String _name;
/** The presence of alcohol */
private boolean _isAlcohol;
/** Is fizzy */
private boolean _isFizzy;
/** Is hot drink */
private boolean _isHot;
Date _dateOfManufacture;
/*public Beverage(String name, boolean isAlcohol, boolean isFizzy, boolean isHot, Date dateOfManufacture, int makerID, int supplierID, int warehouseID){
_name = name;
_isAlcohol = isAlcohol;
_isFizzy = isFizzy;
_isHot = isHot;
_makerID = makerID;
_supplierID = supplierID;
_warehouseID = warehouseID;
_dateOfManufacture = dateOfManufacture;
}*/
public Beverage(String name, boolean isAlcohol, boolean isFizzy, boolean isHot, Date dateOfManufacture, int makerID, int supplierID, int warehouseID, int id){
_name = name;
_isAlcohol = isAlcohol;
_isFizzy = isFizzy;
_isHot = isHot;
_makerID = makerID;
_supplierID = supplierID;
_warehouseID = warehouseID;
_id = id;
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.