Class Piastrella
java.lang.Object
it.unimi.di.prog2.temisvolti.piastrelle.Piastrella
- All Implemented Interfaces:
Rivestimento
- Direct Known Subclasses:
PiastrellaQuadrata
,PiastrellaRomboidale
,PiastrellaTriangolare
Classe astratta e immutabile che rappresenta una piastrella; è una implementa
parzialmente l'interfaccia
Rivestimento
, il cui stato è dato dal costo.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Il costo della piastrella, è sempre positivo. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface it.unimi.di.prog2.temisvolti.piastrelle.Rivestimento
superficie
-
Field Details
-
costo
private final int costoIl costo della piastrella, è sempre positivo.
-
-
Constructor Details
-
Piastrella
public Piastrella(int costo) Costruisce una piastrella dato il suo costo.- Parameters:
costo
- il costo.- Throws:
IllegalArgumentException
- se il costo non è positivo.
-
-
Method Details
-
costo
public int costo()Description copied from interface:Rivestimento
Restituisce il costo del rivestimento.- Specified by:
costo
in interfaceRivestimento
- Returns:
- il costo, ha sempre valore positivo.
-