Class Piastrella

java.lang.Object
it.unimi.di.prog2.temisvolti.piastrelle.Piastrella
All Implemented Interfaces:
Rivestimento
Direct Known Subclasses:
PiastrellaQuadrata, PiastrellaRomboidale, PiastrellaTriangolare

public abstract class Piastrella extends Object implements Rivestimento
Classe astratta e immutabile che rappresenta una piastrella; è una implementa parzialmente l'interfaccia Rivestimento, il cui stato è dato dal costo.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    Il costo della piastrella, è sempre positivo.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Piastrella(int costo)
    Costruisce una piastrella dato il suo costo.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Restituisce il costo del rivestimento.

    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 costo
      Il 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 interface Rivestimento
      Returns:
      il costo, ha sempre valore positivo.