|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Auction
An Auction is a container for zero
or more Items currently up for bid.
A User must first log into the
auction in order to place a bid on an item.
| Field Summary | |
static int |
MAX_ITEMS
Constant representing the maximum number of items that can be added to an auction. |
| Constructor Summary | |
Auction()
Creates a fresh auction with no items in it. |
|
| Method Summary | |
Auction |
add(Item item)
Adds the given item to this auction, if it fits, and then
returns this auction. |
void |
bidOn(int itemNo,
int amount)
Attempts to place a bid on the indicated item for the given amount by the user currently logged in. |
void |
login(User user,
String password)
Logs the given user into this auction, assuming the
supplied password checks out. |
void |
printHistory(int itemNo)
Prints the bidding history of the indicated item. |
String |
toString()
Returns a textual representation of this auction as a numbered list of items. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int MAX_ITEMS
| Constructor Detail |
public Auction()
| Method Detail |
public Auction add(Item item)
item to this auction, if it fits, and then
returns this auction.
public void login(User user,
String password)
user into this auction, assuming the
supplied password checks out.
public String toString()
toString in class Object
public void bidOn(int itemNo,
int amount)
amount by the user currently logged in. Fails if
noone is logged in or if the itemNo
is out of range.
public void printHistory(int itemNo)
itemNo is out of range.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||