package it.unisa.info13d.Articoli; import java.io.Serializable; import java.util.GregorianCalendar; /** * Created with MONSTER. * User: xgiovio * Date: 16/12/13 * Time: 18.47 */ public class CeneInRistoranti implements Utilizzabile, Serializable{ /** * * @param idCena * @param nomeRistorante * @param luogo * @param descrizione_cena * @param costoPerPersona * @param dataScadenzaOffertaCena * @param numCenedaVendere */ public CeneInRistoranti (int idCena, String nomeRistorante, String luogo, String descrizione_cena, double costoPerPersona, GregorianCalendar dataScadenzaOffertaCena, int NumCenedaVendere){ this.idCena=idCena; this.nomeRistorante=nomeRistorante; this.luogo=luogo; this.descrizione_cena=descrizione_cena; this.costoPerPersona=costoPerPersona; this.dataScadenzaOffertaCena=dataScadenzaOffertaCena; this.numCenedaVendere=numCenedaVendere; } @Override public boolean eAcquistabile() { if((dataScadenzaOffertaCena.before(new GregorianCalendar())) && (numCenedaVendere>ceneVendute)) return true; return false; } public int getIdCena() { return idCena; } public String getNomeRistorante() { return nomeRistorante; } public String getLuogo() { return luogo; } public String getDescrizione_cena() { return descrizione_cena; } public double getCostoPerPersona() { return costoPerPersona; } public GregorianCalendar getDataScadenzaOffertaCena() { return dataScadenzaOffertaCena; } public int getNumCenedaVendere() { return numCenedaVendere; } public int getCeneVendute() { return ceneVendute; } public void setNomeRistorante(String nomeRistorante) { this.nomeRistorante = nomeRistorante; } public void setLuogo(String luogo) { this.luogo = luogo; } public void setDescrizione_cena(String descrizione_cena) { this.descrizione_cena = descrizione_cena; } public void setCostoPerPersona(double costoPerPersona) { this.costoPerPersona = costoPerPersona; } public void setDataScadenzaOffertaCena(GregorianCalendar dataScadenzaOffertaCena) { this.dataScadenzaOffertaCena = dataScadenzaOffertaCena; } public void setNumCenedaVendere(int numCenedaVendere) { this.numCenedaVendere = numCenedaVendere; } private int idCena; private String nomeRistorante; private String luogo; private String descrizione_cena; private double costoPerPersona; private GregorianCalendar dataScadenzaOffertaCena; private int numCenedaVendere; private int ceneVendute; }