Class Market
java.lang.Object
org.episteme.social.economics.Market
- All Implemented Interfaces:
Named
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds stock to the market.Buys a good from the market.getName()Gets the price of a good.intChecks stock level.Sells a good to the market.voidSets the price for a specific good.
-
Constructor Details
-
Market
-
-
Method Details
-
getName
-
getCurrency
-
setPrice
-
getPrice
-
addStock
Adds stock to the market. -
getStock
Checks stock level. -
buy
Buys a good from the market. Decreases inventory.- Parameters:
good- to buyquantity- amount to buy- Returns:
- Total cost
- Throws:
IllegalStateException- if insufficient stock
-
sell
-