|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object P2
public class P2
The Project 2 main class. CS 537, Spring 2007, Project 2.
Constructor Summary | |
---|---|
P2()
|
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 |
debug(String format,
Object... args)
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 int |
randInt(int max)
Utility to generate a random non-negative integer less than max. |
static int |
randInt(int min,
int max)
Utility to generate a random integer between min and max (inclusive). |
static void |
setVerbose(boolean on)
Turns debugging output on or off. |
static Trader |
specialist(Grain g)
Returns the specialist for a given grain. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public P2()
Method Detail |
---|
public static void setVerbose(boolean on)
on
- if true, turn debugging on; otherwise turn it off.public static Trader specialist(Grain g)
g
- the grain.
public static void debug(Object message)
message
- the message to print.public static void debug(String format, Object... args)
format
- a printf-like format for the messageargs
- arguments to the printfpublic 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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |