|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.liv.auction.core.Shout
A class representing a shout in an auction. A shout may be either a bid (offer to buy) or an ask (offer to sell).
Shouts are mutable within this package for performance reasons, hence care should be taken not to rely on, e.g. shouts held in collections remaining constant.
| Nested Class Summary | |
static class |
Shout.MutableShout
A Shout that is publically mutable. |
| Field Summary | |
protected TradingAgent |
agent
The agent placing this offer |
protected Shout |
child
The child of this shout. |
protected long |
id
The unique id of this shout |
protected boolean |
isBid
True if this shout is a bid. |
protected double |
price
The price of this offer |
protected int |
quantity
The number of items offered/wanted. |
| Constructor Summary | |
Shout()
|
|
Shout(Shout existing)
|
|
Shout(TradingAgent agent)
|
|
Shout(TradingAgent agent,
int quantity,
double price,
boolean isBid)
|
|
| Method Summary | |
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object o)
|
TradingAgent |
getAgent()
|
Shout |
getChild()
Get the child of this shout. |
long |
getId()
|
double |
getPrice()
|
int |
getQuantity()
|
int |
hashCode()
|
boolean |
isAsk()
|
boolean |
isBid()
|
boolean |
isValid()
|
static double |
maxPrice(Shout s1,
Shout s2)
|
static double |
minPrice(Shout s1,
Shout s2)
|
boolean |
satisfies(Shout other)
|
java.lang.String |
toPrettyString()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int quantity
protected double price
protected TradingAgent agent
protected boolean isBid
protected long id
protected Shout child
| Constructor Detail |
public Shout(TradingAgent agent,
int quantity,
double price,
boolean isBid)
public Shout(Shout existing)
public Shout(TradingAgent agent)
public Shout()
| Method Detail |
public int getQuantity()
public double getPrice()
public TradingAgent getAgent()
public boolean isBid()
public boolean isAsk()
public boolean satisfies(Shout other)
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic boolean isValid()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedExceptionpublic java.lang.String toString()
public java.lang.String toPrettyString()
public static double maxPrice(Shout s1,
Shout s2)
public static double minPrice(Shout s1,
Shout s2)
public Shout getChild()
public long getId()
public int hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||