Class Warehouse

java.lang.Object
  |
  +--Warehouse

public class Warehouse
extends java.lang.Object

Simulates a warehouse containing television sets.

Version:
1.0
Author:
David Matuszek

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

Warehouse

public Warehouse()
Creates a warehouse with some initial number of randomly generated television sets.

Method Detail

numberInStock

public int numberInStock()
Returns the number of objects (currently, just televisions) in stock.

Returns:
The number of objects still in this warehouse.

request

public java.lang.Object[] request(int number)
                           throws OutOfStockException
Returns the given number of televisions from the warehouse.

Parameters:
number - The number of televisions requested.
Returns:
An array of Objects (each of which will be a television).
Throws:
OutOfStockException - Indicates that the request cannot be fulfilled.