|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.commerce.zocalo.history.CostAccounter
public class CostAccounter
Compute costs of acquiring positions. Relies on DB Trade and Redemption records. Distinguish costs of buying shares, costs to buy complements when selling, and value of complete sets liquidated, as well as shares redeemed when markets close.
Constructor Summary | |
---|---|
CostAccounter(SecureUser user,
Market market)
|
Method Summary | |
---|---|
Quantity |
getBuyCost(java.lang.String position)
How much did the user pay to acquire holdings in position? Doesn't count sales. |
Quantity |
getBuyQuantity(java.lang.String position)
How many units of position did the user buy? |
Quantity |
getCost(java.lang.String pos)
How much did the user spend acquiring the current holdings in position? |
Quantity |
getQuantity(java.lang.String pos)
How much of position does the user hold? |
Quantity |
getRedemptions(java.lang.String position)
How many shares of position did the user hold? |
Quantity |
getRedemptionValue(java.lang.String pos)
How much did the user receive when the position was closed out? |
Quantity |
getSellCost(java.lang.String position)
how much did the user receive by selling position? In a unary market, the user received this much in exchange for coupons already held, otherwise the user spent this amount to acquire complements to position. |
Quantity |
getSellQuantity(java.lang.String position)
How many units of position did the user sell? In multi-outcome markets, how many complementary sets did the user sell? |
Quantity |
totalCost()
How much did the user pay for current holdings in all positions of this claim? |
Quantity |
totalRedemptions()
How many coupons did the user hold in all positions when the claim was settled? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CostAccounter(SecureUser user, Market market)
Method Detail |
---|
public Quantity totalCost()
public Quantity totalRedemptions()
public Quantity getBuyQuantity(java.lang.String position)
public Quantity getBuyCost(java.lang.String position)
public Quantity getSellQuantity(java.lang.String position)
public Quantity getSellCost(java.lang.String position)
public Quantity getRedemptions(java.lang.String position)
public Quantity getRedemptionValue(java.lang.String pos)
public Quantity getQuantity(java.lang.String pos)
public Quantity getCost(java.lang.String pos)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |