java.lang.Object | +--Warehouse
Simulates a warehouse containing television sets.
| Constructor Summary | |
Warehouse()
Creates a warehouse with some initial number of randomly generated television sets. |
|
| Method Summary | |
int |
numberInStock()
Returns the number of objects (currently, just televisions) in stock. |
java.lang.Object[] |
request(int number)
Returns the given number of televisions from the warehouse. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Warehouse()
| Method Detail |
public int numberInStock()
public java.lang.Object[] request(int number)
throws OutOfStockException
number - The number of televisions requested.
OutOfStockException - Indicates that the request cannot be fulfilled.