Class Consumer

Object
  extended byConsumer
All Implemented Interfaces:
IBM, Runnable

public class Consumer
extends Object
implements Runnable, IBM

CS 537, Spring 2004, Project 2. An energy consumer.


Field Summary
 
Fields inherited from interface IBM
GOLD, metalName, METALS, PLATINUM, URANIUM
 
Constructor Summary
Consumer()
           
 
Method Summary
 void getConsumption(int[] result)
          Reports on the total amount consumed thus far.
 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()
Method Detail

getConsumption

public void getConsumption(int[] result)
Reports on the total amount consumed thus far.

Parameters:
result - a vector of amounts, one for each metal, allocated by the caller and filled in by this Consumer.

run

public void run()
Main loop. Repeatedly generates random orders to random brokers.

Specified by:
run in interface Runnable