Class Pavimentazione.Componente

java.lang.Object
it.unimi.di.prog2.temisvolti.piastrelle.Pavimentazione.Componente
All Implemented Interfaces:
Rivestimento
Enclosing class:
Pavimentazione

public static class Pavimentazione.Componente extends Object implements Rivestimento
Un componente di una pavimentazione, ossia una certa quantità di un dato rivestimento.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    La quantità di rivestimenti di cui è costituito il componente, è sempre positiva.
    Il rivestimento di cui è costituito questo componente, non è mai null.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Componente(int quantità, Rivestimento rivestimento)
    Costruisce una pavimentazione, data una quantità del rivestimento che lo costituisce.
  • Method Summary

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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rivestimento

      public final Rivestimento rivestimento
      Il rivestimento di cui è costituito questo componente, non è mai null.
    • quantità

      public final int quantità
      La quantità di rivestimenti di cui è costituito il componente, è sempre positiva.
  • Constructor Details

    • Componente

      public Componente(int quantità, Rivestimento rivestimento)
      Costruisce una pavimentazione, data una quantità del rivestimento che lo costituisce. Implementa Rivestimento nel modo ovvio: costo e superficie sono ottenuti moltiplicando quelle del rivestimento per la quantità in cui è presente.
      Parameters:
      quantità - la quantità.
      rivestimento - il rivestimento.
      Throws:
      IllegalArgumentException - se la quantità non è positiva, o il rivestimento è null.
  • 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.
    • superficie

      public int superficie()
      Description copied from interface: Rivestimento
      Restituisce la superficie del rivestimento.
      Specified by:
      superficie in interface Rivestimento
      Returns:
      la superficie, ha sempre valore positivo.