Class Supplier

Object
  extended by Supplier
All Implemented Interfaces:
Runnable

public class Supplier
extends Object
implements Runnable

A supplier of grain.
CS 537, Spring 2007, Project 3.


Field Summary
private  Order delivered
          Total delivered thus far.
private  int iterations
          Number of times to iterate before terminating.
private  Order maxSupply
          Maximum amount of each grain to supply on each iteration.
private  int meanSleepTime
          Mean time to sleep between iterations (in milliseconds).
private static int VERSION
          Source version number.
 
Constructor Summary
Supplier(int iterations)
          Creates a new supplier.
 
Method Summary
 Order getProduction()
          Indicates the amount of each grain delivered.
 void run()
          Main loop.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

private static final int VERSION
Source version number.

See Also:
Constant Field Values

iterations

private int iterations
Number of times to iterate before terminating.


meanSleepTime

private int meanSleepTime
Mean time to sleep between iterations (in milliseconds).


maxSupply

private Order maxSupply
Maximum amount of each grain to supply on each iteration.


delivered

private Order delivered
Total delivered thus far.

Constructor Detail

Supplier

public Supplier(int iterations)
Creates a new supplier.

Parameters:
iterations - the number of times to iterate before terminating.
Method Detail

getProduction

public Order getProduction()
Indicates the amount of each grain delivered.

Returns:
an indication of the total amount of each grain delivered to traders thus far.

run

public void run()
Main loop. Repeatedly supply resources to the warehouse.

Specified by:
run in interface Runnable