Class Consumer

Object
  extended byConsumer
All Implemented Interfaces:
IBM, Runnable

public class Consumer
extends Object
implements Runnable, IBM

CS 537, Fall 2004, Project 3. A consumer of metals.


Field Summary
 
Fields inherited from interface IBM
GOLD, metalName, METALS, PLATINUM, URANIUM
 
Constructor Summary
Consumer(int id, Broker broker)
          Create a new Consumer object.
 
Method Summary
 void printReport()
          Print information about the history of this consumer.
 void run()
          Main loop.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Consumer

public Consumer(int id,
                Broker broker)
Create a new Consumer object.

Parameters:
id - the unique id of this consumer.
broker - the broker to contact to get stuff.
Method Detail

printReport

public void printReport()
Print information about the history of this consumer.


run

public void run()
Main loop. Repeatedly generate random orders to the broker until the broker tells us to stop. Then print some info and return.

Specified by:
run in interface Runnable