|
||||||||||
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 Broker
result
- 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 Broker
order
- the amount needed of each metal.public void swap(int what, int ounces)
swap
in interface Broker
what
- the metal the other broker wants to swap.ounces
- the number of ounces to swap.public void deliver(int ounces)
deliver
in interface Broker
ounces
- 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 |