Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
L
M
N
O
P
R
S
T
U
V
W
A
algorithm
- Variable in class
Trader
The algorithm used by this Trader.
algorithm1()
- Method in class
Trader
Tries to satisfy and release one or more customers.
algorithm2()
- Method in class
Trader
Tries to satisfy and release one or more customers.
algorithm3()
- Method in class
Trader
Tries to satisfy and release one or more customers.
algorithm4()
- Method in class
Trader
Tries to satisfy and release one or more customers.
alloc
- Variable in class
Order
The amount allocated thus far.
arg
- Variable in class
GetOpt
The flags argument currently in use.
argv
- Variable in class
GetOpt
The arguments to main (note that argv[0] is the first arg, not the class name.
await()
- Method in class
Order
Await fulfillment of this order.
B
buy(int, int[])
- Method in class
Trader
Accepts a request from a customer and blocks the customer until the request can be satisfied.
C
cancel(int[])
- Method in class
Order
Reject this Order.
cname
- Static variable in interface
Enron
Table translating commodity codes to names.
COAL
- Static variable in interface
Enron
Code for the coal commodity
COMMODITIES
- Static variable in interface
Enron
Number of commodities
complete()
- Method in class
Order
Signal completion.
consumed
- Variable in class
Customer
Total consumed thus far
cthread
- Static variable in class
Project3
Array of Customer threads.
cunit
- Static variable in interface
Enron
Table translating commodities to units.
customer
- Static variable in class
Project3
Array of Customer instances.
Customer
- class
Customer
.
CS 537, Fall 2002, Project 3.
Customer(int, Trader)
- Constructor for class
Customer
Create a new Customer object.
customerCount
- Static variable in class
Project3
Number of customers (from the command line).
customers()
- Static method in class
Project3
Get the number of customers.
D
debug(Object)
- Static method in class
Project3
Debug print.
delivered
- Variable in class
Trader
The total amount delivered to Customers
done
- Variable in class
Order
Indication that this request has been released by calling release().
done
- Variable in class
Trader
Flag to indicate that the Supplier has told us to shut down.
E
ELEC
- Static variable in interface
Enron
Code for the electricity commodity
enqueue(int, int[])
- Method in class
Trader
Creates an Order object and places it onto the waiters list.
Enron
- interface
Enron
.
CS 537, Fall 2002, Project 2.
expo(Random, int)
- Static method in class
Project3
Generate an exponentially distributed random number.
F
fmt
- Static variable in class
Customer
A format for printing fractions to two decimal places.
fulfilled
- Variable in class
Trader
Number of requests fulfilled
G
GAS
- Static variable in interface
Enron
Code for the natural gas commodity
GetOpt
- class
GetOpt
.
Java version of GNU getopt.
GetOpt(String, String[], String)
- Constructor for class
GetOpt
Create a new option parser.
GetOpt(String, String[], String, LongOption[])
- Constructor for class
GetOpt
Create a new option parser.
GetOpt(String, String[], String, LongOption[], boolean)
- Constructor for class
GetOpt
Create a new option parser.
give(int[], int)
- Method in class
Order
Give some resources to this Order from supply.
H
hasArg
- Variable in class
LongOption
I
id
- Variable in class
Customer
Id of this customer
id
- Variable in class
Order
The requesting customer's id (for debugging output).
incr(int[], int[])
- Static method in class
Trader
Utility procedure to update an array.
iterations
- Variable in class
Supplier
Number of times to iterate before terminating.
iterations
- Variable in class
Trader
The number of iterations to run.
L
lessOrEqual(int[])
- Method in class
Order
Check whether the remainder of this request is less than or equal to amt (in all commodities).
longind
- Variable in class
GetOpt
Index in longopts of a long-named option found.
longonly
- Variable in class
GetOpt
Flag to indicate that only long options should be recognized.
LongOption
- class
LongOption
.
Helper class for GetOpt.
LongOption(String, int, char)
- Constructor for class
LongOption
longopts
- Variable in class
GetOpt
Table of long options
M
main(String[])
- Static method in class
GetOpt
Main program for testing.
main(String[])
- Static method in class
Project3
Main program for project 3.
maxPurchase
- Variable in class
Customer
Mean amount of each quantity to purchase on each request.
maxSupply
- Variable in class
Supplier
Maximum amount of each commodity to supply on each iteration.
meanSleepTime
- Variable in class
Customer
Mean sleep time (in milliseconds) between purchase requests.
meanSleepTime
- Variable in class
Supplier
Mean time to sleep between iterations (in milliseconds).
N
name
- Variable in class
LongOption
nextchar
- Variable in class
GetOpt
The index in arg of the next option flag to be examined.
nextOpt()
- Method in class
GetOpt
Return the next option.
nextSeq
- Static variable in class
Order
Source of sequence numbers.
NO_ARG
- Static variable in class
LongOption
NUM_ALGORITHMS
- Static variable in class
Trader
The number of algorithms implemented.
numberOfPurchases
- Variable in class
Customer
Number of buying requests completed by this Consumer
O
OIL
- Static variable in interface
Enron
Code for the oil commodity
onHand
- Variable in class
Trader
The current stock on hand of each of the commodities
OPT_ARG
- Static variable in class
LongOption
optarg
- Variable in class
GetOpt
For communicatino from nextOpt() to the caller.
opterr
- Variable in class
GetOpt
If set to false, to not print messages to System.err for unrecognized options.
optind
- Variable in class
GetOpt
Index in argv of the next element to be scanned.
optopt
- Variable in class
GetOpt
Set to an option character which was unrecognized.
Order
- class
Order
.
CS 537, Fall 2002, Project 3.
Order(int, int[])
- Constructor for class
Order
Creates a new Order.
orderToString(int[])
- Static method in class
Project3
Turn an order into a printable string.
P
pl(Object)
- Static method in class
Customer
Abbreviation for System.out.println.
pl(Object)
- Static method in class
Supplier
Abbreviation for System.out.println.
pl(Object)
- Static method in class
Trader
Abbreviation for System.out.println.
printErr(String, String, String)
- Method in class
GetOpt
A convenience routine to print an error to System.err if opterr is true.
printReport()
- Method in class
Customer
Print information about the history of this customer.
progname
- Variable in class
GetOpt
The "program" (class) name (counterpart of argv[0] in Unix)
Project3
- class
Project3
.
The Project 3 main class.
Project3()
- Constructor for class
Project3
R
rand
- Variable in class
Customer
A source of random numbers.
rand
- Variable in class
Supplier
Source of random numbers.
recordFulfillment(int[])
- Method in class
Trader
Record the fact that an order was fulfilled.
remaining()
- Method in class
Order
Return the remaining amount requested.
REQ_ARG
- Static variable in class
LongOption
request
- Variable in class
Order
The original amount requested.
result
- Variable in class
Order
Return code to be returned by await.
run()
- Method in class
Customer
Main loop.
run()
- Method in class
Supplier
Main loop.
run()
- Method in class
Trader
Main loop.
S
satisfied()
- Method in class
Order
Check whether this order is satified.
seq
- Variable in class
Order
The sequence number of this request in the order received.
setVerbose(boolean)
- Static method in class
Project3
Turn debugging output on or off.
shortopts
- Variable in class
GetOpt
Short option flags
showQueue()
- Method in class
Trader
shutDown()
- Method in class
Trader
Tells this Trader to shut down.
shutdownCount
- Variable in class
Trader
Used to keep track of the number of Customers who have been informed that the system is shutting down.
size()
- Method in class
Order
Return the total amount requested.
startTime
- Static variable in class
Project3
Startup time (used to support the time() method.
supplied
- Variable in class
Supplier
Amount supplied.
supplied
- Variable in class
Trader
The total amount received from the Supplier
supplier
- Static variable in class
Project3
The unique Supplier.
Supplier
- class
Supplier
.
CS 537, Fall 2002, Project 3.
Supplier(Trader, int)
- Constructor for class
Supplier
Creates a new supplier.
supply(int[])
- Method in class
Trader
Accepts more resources from the supplier.
T
time()
- Static method in class
Project3
Handy procedure for timing.
tokenize(String)
- Static method in class
GetOpt
Helper procedure for main.
toString()
- Method in class
Order
Turn an Order into a printable string.
totalServiceTime
- Variable in class
Customer
Sum of service times for all requests
trader
- Variable in class
Customer
The trader to buy from.
trader
- Static variable in class
Project3
The unique Trader.
trader
- Variable in class
Supplier
The trader to supply.
Trader
- class
Trader
.
CS 537, Fall 2002, Project 3.
Trader(int)
- Constructor for class
Trader
Creates a new Trader.
U
usage()
- Static method in class
Project3
Print a usage message and terminate.
V
val
- Variable in class
LongOption
verbose
- Static variable in class
Project3
Flag to control debugging output.
W
waiters
- Variable in class
Trader
Queue of waiting customers.
A
B
C
D
E
F
G
H
I
L
M
N
O
P
R
S
T
U
V
W
Package
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes