Class Refiner

Object
  extended byRefiner
All Implemented Interfaces:
IBM, Runnable

public class Refiner
extends Object
implements Runnable, IBM

CS 537, Fall 2004, Project 3. A process that supplies refined metals to a broker.


Field Summary
 
Fields inherited from interface IBM
GOLD, metalName, METALS, PLATINUM, URANIUM
 
Constructor Summary
Refiner(Broker broker, int iterations)
          Creates a new supplier.
 
Method Summary
 void run()
          Main loop.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Refiner

public Refiner(Broker broker,
               int iterations)
Creates a new supplier.

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

run

public void run()
Main loop. Repeatedly supply one unit of each resource to the broker. After iterations iterations, tell the broker to shut down.

Specified by:
run in interface Runnable