Class Product


  • public class Product
    extends Stuff
    A product which consists of various stuff and has some treatments.
    Author:
    Herbert Praehofer
    • Field Detail

      • ingredients

        protected final List<Stuff> ingredients
        List of ingredients.
    • Constructor Detail

      • Product

        protected Product​(Stuff[] ingredients)
        Constructor initializing the ingredients of the product.
        Parameters:
        ingredients - the ingredients of the product
      • Product

        protected Product​(Stuff[] ingredients,
                          Treatment[] treatments)
        Constructor initializing the ingredients and the treatments of the product.
        Parameters:
        ingredients - the ingredients of the product
        treatments - the treatments of the product
    • Method Detail

      • of

        public static Product of​(Stuff... ingredients)
        Creates a product from various stuff.
        Parameters:
        ingredients - the ingredients for the product
        Returns:
        the product
      • getIngrediants

        public List<Stuff> getIngrediants()
        Gets the ingredients of this product.
        Returns:
        the ingredients
      • mix

        public Product mix​(Stuff stuff)
        Creates a new product by mixing a stuff to this product.
        Overrides:
        mix in class Stuff
        Parameters:
        stuff - the added stuff
        Returns:
        the new product