Class Bid

java.lang.Object
  |
  +--Bid

public class Bid
extends Object

A Bid is constructed from a User and a ceiling price. It can be placed on an Item.

Author:
Suzanne Menzel

Constructor Summary
Bid(User user, int ceiling)
          Constructs a Bid from the given User and ceiling price.
 
Method Summary
 int getAmount()
          Returns the current amount that this Bid has been raised to.
 int getCeiling()
          Returns the ceiling price associated with this Bid.
 User getUser()
          Returns the User who constructed this Bid.
 void raiseTo(int value)
          Increases the amount of this Bid up to the given value but no more than its ceiling.
 String toString()
          Returns a textual representation of this Bid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Bid

public Bid(User user,
           int ceiling)
Constructs a Bid from the given User and ceiling price.

Method Detail

getUser

public User getUser()
Returns the User who constructed this Bid.


getCeiling

public int getCeiling()
Returns the ceiling price associated with this Bid.


getAmount

public int getAmount()
Returns the current amount that this Bid has been raised to. Returns zero if this Bid has not been accepted on some item.


raiseTo

public void raiseTo(int value)
Increases the amount of this Bid up to the given value but no more than its ceiling. Does nothing if the value does not exceed the current amount in this Bid.


toString

public String toString()
Returns a textual representation of this Bid.

Overrides:
toString in class Object