|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectceleboss.data.Portfolio
This class represents a Portfolio associated to an account.
| Field Summary | |
static java.lang.String |
CASH
Property name for events of Cash property |
static java.lang.String |
CHARTPOSITION
Event property name when chart position changes |
static java.lang.String |
GAIN
Property name for event of Weekly Gain property |
static java.lang.String |
MILLIONS
Property name for events of Update property |
static boolean |
MULTIPLESHARE_MODE
This controls th4e mode that shares are recorded. |
static java.lang.String |
NEWSHARE
Property name for event of new Share property |
static java.lang.String |
PREDICTDIV
Property name for events of Update property |
static java.lang.String |
PREDICTVALUE
Property name for events of Update property |
static java.lang.String |
PREDICTWORTH
Property name for events of Update property |
static java.lang.String |
PROFIT
Property name for events of Profit property |
static java.lang.String |
REMOVESHARE
Property name for event of remove Share property |
static java.lang.String |
TOTALWORTH
Property name for events of Total Worth property |
static java.lang.String |
UPDATED
Property name for events of Update property |
| Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener arg0)
Add a listener. |
void |
addPropertyChangeListener(java.lang.String arg0,
java.beans.PropertyChangeListener arg1)
Add a listener for a specific Property. |
java.lang.String |
buyShares(Celebrity celebrity,
int number,
OrderNotifier notify)
This will issue a buy order for the specified celebrity. |
Portfolio |
createLocal()
Create a local version of this portfolio. |
ChangableValue |
getCashAvailable()
Return the amount of cash available for purchases |
java.util.Collection |
getCelebrities()
Return a colelciton of the celebrits that this portfolio holds shares. |
int |
getChartPosition()
The current chart position for today. |
java.util.Date |
getLastUpdate()
Return the date when this Portfolio was last updated. |
CelebrityManager |
getManager()
Get a handle to the controlling manager. |
java.lang.Integer |
getMillions()
Return the amount of cash banked |
java.lang.String |
getName()
This returns a readible name based on the UserId and the status. |
ChangableValue |
getPredictedDividend()
Thepredicted dividend at the end of the dividend week. |
ChangableValue |
getPredictedValue()
The predicted value at the end of the trading week. |
ChangableValue |
getPredictedWorth()
The predicted worth at the end of the trading week. |
ChangableValue |
getProfit()
The current profit over the 7 days cycle. |
java.util.Collection |
getShares()
Return a list of shares this portfolio has |
ChangableValue |
getTotalWorth()
Return the total worth of this portfolio. |
java.lang.String |
getUserAlias()
Get the user name of account |
int |
getUserId()
|
java.lang.String |
getUserName()
Get the user id owning this portfolio. |
ChangableValue |
getWeeklyGain()
Get the percentage gain of the total worth ove rthe last 7 days. |
boolean |
isLive()
Is this portfolio remote or local. |
boolean |
isReadOnly()
Can this portfolio be manipulated |
void |
propertyChange(java.beans.PropertyChangeEvent arg0)
An change has happened in the Share Blocks |
void |
refresh()
Refresh this portfolio. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener arg0)
Remove a previously registered listener. |
void |
removePropertyChangeListener(java.lang.String arg0,
java.beans.PropertyChangeListener arg1)
Remove a previousl registered listener |
java.lang.String |
sellShares(Celebrity celebrity,
int number,
OrderNotifier notify)
This will issue a sell order for the specified celebrity. |
void |
setCashAvailable(float cash)
Update how much cash is availalbe. |
void |
setChartPosition(int i)
Update the current chart position. |
void |
setMillions(int mils)
Update how much money is banked |
void |
setShares(java.util.Collection newShares)
Update the share portfolio |
void |
setUpdated()
This portfolio recorded has just been updated |
void |
setUserDetails(java.lang.String newUser,
int id)
Update the usernameof portfolio. |
void |
setUsername(java.lang.String username,
java.lang.String password)
Update the userid and password assigned to this Portfolio |
void |
setWeeklyGain(float newGain)
Update the percentage gain value. |
java.lang.String |
toString()
String representation of Portfolio |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String CASH
public static final java.lang.String CHARTPOSITION
public static final java.lang.String GAIN
public static final java.lang.String MILLIONS
public static final boolean MULTIPLESHARE_MODE
public static final java.lang.String NEWSHARE
public static final java.lang.String PREDICTDIV
public static final java.lang.String PREDICTVALUE
public static final java.lang.String PREDICTWORTH
public static final java.lang.String PROFIT
public static final java.lang.String REMOVESHARE
public static final java.lang.String TOTALWORTH
public static final java.lang.String UPDATED
| Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener arg0)
addPropertyChangeListener in interface Monitorablearg0 - Listener.
public void addPropertyChangeListener(java.lang.String arg0,
java.beans.PropertyChangeListener arg1)
arg0 - Property namearg1 - Listener to be notified
public java.lang.String buyShares(Celebrity celebrity,
int number,
OrderNotifier notify)
celebrity - Celebrity to buynumber - Number of shares.notify - Inform this object when the order is complete.
public Portfolio createLocal()
public ChangableValue getCashAvailable()
public java.util.Collection getCelebrities()
public int getChartPosition()
public java.util.Date getLastUpdate()
public CelebrityManager getManager()
getManager in interface ShareOwnerpublic java.lang.Integer getMillions()
public java.lang.String getName()
public ChangableValue getPredictedDividend()
public ChangableValue getPredictedValue()
public ChangableValue getPredictedWorth()
public ChangableValue getProfit()
public java.util.Collection getShares()
public ChangableValue getTotalWorth()
public java.lang.String getUserName()
public int getUserId()
public java.lang.String getUserAlias()
public ChangableValue getWeeklyGain()
public boolean isLive()
public boolean isReadOnly()
public void propertyChange(java.beans.PropertyChangeEvent arg0)
propertyChange in interface java.beans.PropertyChangeListenerarg0 - Description.public void refresh()
public void removePropertyChangeListener(java.beans.PropertyChangeListener arg0)
removePropertyChangeListener in interface Monitorablearg0 - to remove.
public void removePropertyChangeListener(java.lang.String arg0,
java.beans.PropertyChangeListener arg1)
arg0 - Property namearg1 - Previous listeners
public java.lang.String sellShares(Celebrity celebrity,
int number,
OrderNotifier notify)
celebrity - Celebrity to sellnumber - Number of shares.notify - Inform this object when the order is complete.
public void setCashAvailable(float cash)
cash - New cash available.public void setChartPosition(int i)
i - New chart position.public void setMillions(int mils)
mils - New cash banked.public void setShares(java.util.Collection newShares)
newShares - Collection of new shares.public void setUpdated()
public void setUserDetails(java.lang.String newUser,
int id)
newUser - New user name.id - The identifier of the user account.
public void setUsername(java.lang.String username,
java.lang.String password)
username - New User name.password - New passwordpublic void setWeeklyGain(float newGain)
newGain - New gain percentagepublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||