public class Libro {
	private String autore, titolo;
    private float prezzo;
    private int disp;

	public Libro(String autore, String titolo, float prezzo) {
        this.autore = autore;
        this.titolo = titolo;
        this.prezzo = prezzo;
		this.disp = 0;
	}

	public String getAutore() {
		return this.autore;
	}
    
	public String getTitolo() {
		return this.titolo;
	}

	public float getPrezzo() {
		return this.prezzo;
	}

	public int getDisp() {
		return this.disp;
	}

	public void setDisp(boolean prestito, int n) {
		if (prestito) this.disp -= n;
		else this.disp += n;
	}

	public boolean isDisp(int n) {
		return this.disp >= n;
	}

    public boolean uguale( Libro x ) {
		return x.autore.equals(this.autore) &&
		       x.titolo.equals(this.titolo) &&
		       x.prezzo == this.prezzo;
	}
}

