|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectProject2
The Project 2 main class.
| Field Summary |
| Fields inherited from interface IBM |
GOLD, metalName, METALS, PLATINUM, URANIUM |
| Constructor Summary | |
Project2()
|
|
| Method Summary | |
static void |
debug(Object message)
If the debugging flag is on, prints a message, preceded by the name of the current thread. |
static void |
main(String[] args)
Main program for project 2. |
static String |
orderToString(int[] order)
Turns an order into a printable string. |
static int |
randInt(int max)
Utility to generate a random integer in the range 0 <= x < max. |
static int |
randInt(int min,
int max)
Utility to generate a random integer in the range min <= x <= max. |
static void |
setVerbose(boolean on)
Turns debugging output on or off. |
static Broker |
specialist(int metal)
Returns the specialist for a given metal. |
static void |
terminateProgram()
Gathers allocation information from the Refiner, Consumers, and Brokers and prints it. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Project2()
| Method Detail |
public static void setVerbose(boolean on)
on - if true, turn debugging on; otherwise turn it off.public static Broker specialist(int metal)
metal - the metal code.
public static void debug(Object message)
message - the message to print.public static String orderToString(int[] order)
order - an indication of the amount of each metal desired.
public static int randInt(int max)
max - integer one greater than the largest possible result.
public static int randInt(int min,
int max)
min - the smallest possible result.max - the largest possible result.
public static void main(String[] args)
args - the command-line arguments.public static void terminateProgram()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||