|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectBrokerImplementation
CS 537, Spring 2004, Project 2. Implementation of a broker.
| Field Summary |
| Fields inherited from interface IBM |
GOLD, metalName, METALS, PLATINUM, URANIUM |
| Constructor Summary | |
BrokerImplementation(int specialty)
Creates a new Broker. |
|
| Method Summary | |
void |
deliver(int ounces)
Accepts more metal from the refiner. |
void |
get(int[] order)
A purchase request from a consumer. |
void |
getAmountOnHand(int[] result)
Report on the total amount of resources held by this Broker. |
void |
swap(int what,
int ounces)
Responds to a swap request from another broker. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BrokerImplementation(int specialty)
specialty - my "special" metal -- the one for which this Broker is
the supplier.| Method Detail |
public void getAmountOnHand(int[] result)
getAmountOnHand in interface Brokerresult - a vector of amounts, one for each metal, allocated
by the caller and filled in by this Broker.public void get(int[] order)
get in interface Brokerorder - the amount needed of each metal.
public void swap(int what,
int ounces)
swap in interface Brokerwhat - the metal the other broker wants to swap.ounces - the number of ounces to swap.public void deliver(int ounces)
deliver in interface Brokerounces - the number of ounces of this Broker's "special" metal
being delivered.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||