|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--data.QuoteValue
A QuoteValue consists of two values: A bid and an offer.
QuoteValues usually represent prices. The bid is the price to be paid if someone wants to buy something from the Shop. The offer is the price paid when the Shop bought the product.
QuoteValues have two more attributes: the spread and the mid. While
the mid is the mean value of bid and offer, the spread is defined as bid - offer
.
Field Summary | |
protected Value |
m_vBid
The bid. |
protected Value |
m_vOffer
The offer. |
Constructor Summary | |
QuoteValue(Value vBid,
Value vOffer)
Create a new QuoteValue. |
Method Summary | |
Value |
add(Value v)
|
void |
addAccumulating(Value v)
If the given value is a QuoteValue, its bid and offer get added to this value's bid and offer, resp. |
Object |
clone()
Create and return a deep clone of the QuoteValue. |
int |
compareTo(Object o)
Compare this value to the given one. |
Value |
divide(Value v)
|
void |
divideAccumulating(Value v)
If the given value is a QuoteValue, this value's bid and offer get divided by its bid and offer, resp. |
Value |
getBid()
Get the current bid of this QuoteValue. |
Value |
getMid()
Get the mid of this value. |
Value |
getOffer()
Get the current offer of this QuoteValue. |
Value |
getSpread()
Get the spread of this value. |
boolean |
isAddZero()
True, iff both bid and offer are zero elements with respect to addition. |
boolean |
isMulOne()
True, iff both bid and offer are one elements with respect to multiplication. |
boolean |
isMulZero()
True, iff both bid and offer are zero elements with respect to multiplication. |
Value |
multiply(double dl)
|
Value |
multiply(float fl)
|
Value |
multiply(int n)
|
Value |
multiply(long l)
|
Value |
multiply(Value v)
|
void |
multiplyAccumulating(double dl)
Both bid and offer get multiplied by the given 'scalar'. |
void |
multiplyAccumulating(float fl)
Both bid and offer get multiplied by the given 'scalar'. |
void |
multiplyAccumulating(int n)
Both bid and offer get multiplied by the given 'scalar'. |
void |
multiplyAccumulating(long l)
Both bid and offer get multiplied by the given 'scalar'. |
void |
multiplyAccumulating(Value v)
If the given value is a QuoteValue, its bid and offer get multiplied by this value's bid and offer, resp. |
Value |
subtract(Value v)
|
void |
subtractAccumulating(Value v)
If the given value is a QuoteValue, its bid and offer get subtracted from this value's bid and offer, resp. |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Value m_vBid
protected Value m_vOffer
Constructor Detail |
public QuoteValue(Value vBid, Value vOffer)
vBid
- the bidvOffer
- the offer(vBid.getClass() != vOffer.getClass())
.Method Detail |
public Value getBid()
public Value getOffer()
public Object clone()
public void addAccumulating(Value v)
v
- the value to be added.public void subtractAccumulating(Value v)
v
- the value to be subtracted.public void multiplyAccumulating(Value v)
v
- the value to multiply by.public void multiplyAccumulating(double dl)
dl
- the 'scalar' to multiply by.public void multiplyAccumulating(float fl)
fl
- the 'scalar' to multiply by.public void multiplyAccumulating(long l)
l
- the 'scalar' to multiply by.public void multiplyAccumulating(int n)
n
- the 'scalar' to multiply by.public void divideAccumulating(Value v)
v
- the value to divide by.public Value add(Value v)
addAccumulating(data.Value)
public Value subtract(Value v)
subtractAccumulating(data.Value)
public Value multiply(Value v)
multiplyAccumulating(data.Value)
public Value multiply(double dl)
multiplyAccumulating(double)
public Value multiply(float fl)
multiplyAccumulating(float)
public Value multiply(long l)
multiplyAccumulating(long)
public Value multiply(int n)
multiplyAccumulating(int)
public Value divide(Value v)
divideAccumulating(data.Value)
public Value getSpread()
bid - offer
.public Value getMid()
(bid + offer) / 2
.public int compareTo(Object o)
public boolean isAddZero()
public boolean isMulZero()
public boolean isMulOne()
|
SalesPoint Framework v3.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |