|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectceleboss.data.ShareBlock
Class represents ablock of sharesin a single Celebrity. The classes reacts automatically to changes in price or dividend.
| Field Summary | |
static java.lang.String |
CELEBRITY
Property name for celebrity name |
static java.lang.String |
NUMBEROFSHARES
Property name for number of Shares |
static java.lang.String |
PREDICTEDDIV
Property name for number of estimated |
static java.lang.String |
PREDICTEDVALUE
Property name for number of estimated |
static java.lang.String |
PURCHASED
Property name for purchased date |
| Constructor Summary | |
protected |
ShareBlock(ShareOwner parent,
Celebrity celeb)
|
| Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener arg0)
Add a new property listener. |
protected void |
calculatePredictedDividend()
Calculate the estimate divided based on number of share and when they were purchased. |
protected void |
calculatePredictedValue()
Calculate predicted worth based on shares and predicted price |
protected void |
firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
Fire a change to any listeners that are registered |
Celebrity |
getCelebrity()
Get the celebrity of this block. |
int |
getNumberOfShares()
The number of shares. |
ShareOwner |
getOwner()
Get the Portfolio owning this share block. |
java.lang.Float |
getPredictedDividend()
Return the estimated dividend based on the number of shares and the number of days owned. |
java.lang.Float |
getPredictedValue()
Get the predicted value of this Share block at end of trading week |
java.util.Date |
getPurchased()
What date were these purchased |
void |
init()
THis method is called to initialise the entity once the complete and has either been accepted by the Portfolio or when the Celebrity model has been loaded. |
void |
propertyChange(java.beans.PropertyChangeEvent arg0)
Change has occured |
void |
release()
This share block is no logner needed. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener arg0)
Remove an existing property listener. |
protected void |
setNumberOfShares(int number)
Update the number of shares in this Celebrity. |
void |
setPurchased(java.util.Date date)
Update teh date these were purchased. |
java.lang.String |
toString()
Return a descriptive text |
| 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 CELEBRITY
public static final java.lang.String NUMBEROFSHARES
public static final java.lang.String PREDICTEDDIV
public static final java.lang.String PREDICTEDVALUE
public static final java.lang.String PURCHASED
| Constructor Detail |
protected ShareBlock(ShareOwner parent,
Celebrity celeb)
| Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener arg0)
addPropertyChangeListener in interface Monitorablearg0 - Listenerprotected void calculatePredictedDividend()
protected void calculatePredictedValue()
public Celebrity getCelebrity()
public int getNumberOfShares()
public ShareOwner getOwner()
public java.lang.Float getPredictedDividend()
public java.lang.Float getPredictedValue()
public java.util.Date getPurchased()
public void init()
public void propertyChange(java.beans.PropertyChangeEvent arg0)
propertyChange in interface java.beans.PropertyChangeListenerarg0 - Event describing change.public void release()
public void removePropertyChangeListener(java.beans.PropertyChangeListener arg0)
removePropertyChangeListener in interface Monitorablearg0 - Listenerprotected void setNumberOfShares(int number)
number - New number of sharespublic void setPurchased(java.util.Date date)
date - New date.public java.lang.String toString()
Object.toString()
protected void firePropertyChange(java.lang.String property,
java.lang.Object oldValue,
java.lang.Object newValue)
property - Name of property changedoldValue - Old property value, maybe null.newValue - New property value.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||