class Order extends AnyRef
Class Order
represents orders of zero or more products (in an imaginary and
way simplified online store). This simple implementation does not record every
individual instance of a product added to the order, only the total price of the
added products.
- Alphabetic
- By Inheritance
- Order
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- def addProduct(pricePerUnit: Double, numberOfUnits: Int): Unit
Adds a number of products to the order, as indicated by the parameters.
Adds a number of products to the order, as indicated by the parameters. In practice, what this means is that the total price of the order increases by the total price of the newly added products.
- pricePerUnit
the price of an individual item of the added product type
- numberOfUnits
the number of identical items that are added
- var isExpress: Boolean
whether exceptionally fast delivery has been requested (
true
) or not (false
) - val number: Int
- val orderer: Customer
- def toString: String
Returns a textual description of the order.
Returns a textual description of the order.
- Definition Classes
- Order → AnyRef → Any