celeboss.data
Class Celebrity

java.lang.Object
  extended byceleboss.data.Celebrity
All Implemented Interfaces:
java.lang.Comparable, Monitorable, java.io.Serializable

public class Celebrity
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable, Monitorable

This class represents the stored data of a Celebrity in the remote system.

Version:
1.0
Author:
bevans
See Also:
Serialized Form

Field Summary
static java.lang.String GROWTHHOURLY
          Name for growth today Price property
static java.lang.String GROWTHTODAY
          Name for growth today Price property
static java.lang.String HIGHESTDIVIDEND
          Name for Highest Dividend property
static java.lang.String HISTORICALGROWTH
          Name for Yield property
static java.lang.String LASTDIVIDEND
          Name for prdicted last dividend property
static int MAXDAYS
          Maximum number of previous changes held
static java.lang.String NAME
          Name for Name property
static java.lang.String POTENTIALDIVIDEND
          Name for Dividend property
static java.lang.String PREDICTEDPRICE
          Name for prdicted Price property
static java.lang.String SHAREPRICE
          Name for Share Price property
static java.lang.String UPDATED
          Name for Updated property
static java.lang.String YIELD
          Name for Yield property
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add a new property listener
 void addPropertyChangeListener(java.lang.String propName, java.beans.PropertyChangeListener listener)
          Add a property change listeners for a specific property
 int compareTo(java.lang.Object arg1)
          Compare this celebrity with another based on the name.
 boolean equals(java.lang.Object other)
          Is this Celebrity equals to another
 java.lang.Float getDailyChange(int day)
          Get the percentage change for a specific day.
 PercentChangableValue getGrowthHourly()
          Get the percentage change for the last hour
 PercentChangableValue getGrowthToday()
          Get the percentage change for a today day.
 int getIssue()
          Get the unique issue number for this Celebrity
 java.lang.Float getLastDividend()
          Get the last dividend of this celebrity
 java.util.Date getLastUpdate()
          When was this last updated
 java.util.Date getListingDate()
          Get the dat that this celebrity was first listed.
 CelebrityManager getManager()
          Return the owning manager.
 java.lang.String getName()
          Celebrity full name
 ChangableMinMaxValue getPotentialDividend()
          Get the potential dividend of this celebrity
 ChangableValue getPredictedSharePrice()
          Get the predicted share price at the end of the trading week
 ChangableMinMaxValue getSharePrice()
          Get current share price
 java.lang.String getSymbol()
          Return a URL that points to an image that displays this celebrity.
 PercentChangableValue getYield()
          Get Yield value
 int hashCode()
          Return hashcode based on issue
 void refresh()
          This method queues a refresh command for this Celebrity.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove an existing listener.
 void removePropertyChangeListener(java.lang.String propName, java.beans.PropertyChangeListener listener)
          Remove a property change listeners for a specific property
 void setDailyChange(int day, double f)
          Update one of the daily change values.
 void setGrowthToday(float i)
          Update the growth for today
 void setHighestDividend(java.lang.Float i)
          Update the highest dividend
 void setHighestPrice(float i)
          Update the highest share price
 void setLastDividend(java.lang.Float i)
          Update the last dividend
 void setListingDate(java.util.Date listing)
          Update the date of listing
 void setLowestPrice(float i)
          Update the lowest share price
 void setName(java.lang.String string)
          Update the name.
 void setPotentialDividend(float i)
          Update the potential dividend
 void setSharePrice(float i)
          Update the share price
 void setSymbol(java.lang.String string)
          Define the trading symbol ofthis Celebrity
 void setUpdated()
          This celebrity recorded has just been updated.
 java.lang.String toString()
          Generete a string representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GROWTHHOURLY

public static final java.lang.String GROWTHHOURLY
Name for growth today Price property

See Also:
Constant Field Values

GROWTHTODAY

public static final java.lang.String GROWTHTODAY
Name for growth today Price property

See Also:
Constant Field Values

HIGHESTDIVIDEND

public static final java.lang.String HIGHESTDIVIDEND
Name for Highest Dividend property

See Also:
Constant Field Values

HISTORICALGROWTH

public static final java.lang.String HISTORICALGROWTH
Name for Yield property

See Also:
Constant Field Values

LASTDIVIDEND

public static final java.lang.String LASTDIVIDEND
Name for prdicted last dividend property

See Also:
Constant Field Values

MAXDAYS

public static final int MAXDAYS
Maximum number of previous changes held

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
Name for Name property

See Also:
Constant Field Values

POTENTIALDIVIDEND

public static final java.lang.String POTENTIALDIVIDEND
Name for Dividend property

See Also:
Constant Field Values

PREDICTEDPRICE

public static final java.lang.String PREDICTEDPRICE
Name for prdicted Price property

See Also:
Constant Field Values

SHAREPRICE

public static final java.lang.String SHAREPRICE
Name for Share Price property

See Also:
Constant Field Values

UPDATED

public static final java.lang.String UPDATED
Name for Updated property

See Also:
Constant Field Values

YIELD

public static final java.lang.String YIELD
Name for Yield property

See Also:
Constant Field Values
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a new property listener

Specified by:
addPropertyChangeListener in interface Monitorable
Parameters:
listener - Listener

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propName,
                                      java.beans.PropertyChangeListener listener)
Add a property change listeners for a specific property

Parameters:
propName - Property
listener - Listener

compareTo

public int compareTo(java.lang.Object arg1)
Compare this celebrity with another based on the name.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
arg1 - Compare to this.
Returns:
A comparative orderring

equals

public boolean equals(java.lang.Object other)
Is this Celebrity equals to another

Parameters:
other - Compare to.
Returns:
Equal

getDailyChange

public java.lang.Float getDailyChange(int day)
Get the percentage change for a specific day.

Parameters:
day - Day number
Returns:
Percentage

getGrowthHourly

public PercentChangableValue getGrowthHourly()
Get the percentage change for the last hour

Returns:
Percentage

getGrowthToday

public PercentChangableValue getGrowthToday()
Get the percentage change for a today day.

Returns:
Percentage

getSymbol

public java.lang.String getSymbol()
Return a URL that points to an image that displays this celebrity.

Returns:
URL for the celebrities image

getIssue

public int getIssue()
Get the unique issue number for this Celebrity

Returns:
Issue number

getLastDividend

public java.lang.Float getLastDividend()
Get the last dividend of this celebrity

Returns:
Money value

getLastUpdate

public java.util.Date getLastUpdate()
When was this last updated

Returns:
Update date.

getListingDate

public java.util.Date getListingDate()
Get the dat that this celebrity was first listed.

Returns:
Date of listing

getManager

public CelebrityManager getManager()
Return the owning manager.

Returns:
Celebrity manager

getName

public java.lang.String getName()
Celebrity full name

Returns:
Name

getPotentialDividend

public ChangableMinMaxValue getPotentialDividend()
Get the potential dividend of this celebrity

Returns:
Money value

getPredictedSharePrice

public ChangableValue getPredictedSharePrice()
Get the predicted share price at the end of the trading week

Returns:
Currency value

getSharePrice

public ChangableMinMaxValue getSharePrice()
Get current share price

Returns:
Money of share

getYield

public PercentChangableValue getYield()
Get Yield value

Returns:
Pecentage

hashCode

public int hashCode()
Return hashcode based on issue

Returns:
hashCode

refresh

public void refresh()
This method queues a refresh command for this Celebrity. It will be executed in the background by the CelebrityManager.


removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove an existing listener.

Specified by:
removePropertyChangeListener in interface Monitorable
Parameters:
listener - Listener

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propName,
                                         java.beans.PropertyChangeListener listener)
Remove a property change listeners for a specific property

Parameters:
propName - Property
listener - Listener

setDailyChange

public void setDailyChange(int day,
                           double f)
Update one of the daily change values.

Parameters:
day - Day number to update
f - New value.

setGrowthToday

public void setGrowthToday(float i)
Update the growth for today

Parameters:
i - new dividend

setHighestDividend

public void setHighestDividend(java.lang.Float i)
Update the highest dividend

Parameters:
i - new dividend

setHighestPrice

public void setHighestPrice(float i)
Update the highest share price

Parameters:
i - new dividend

setSymbol

public void setSymbol(java.lang.String string)
Define the trading symbol ofthis Celebrity

Parameters:
string - Trading symbol

setLastDividend

public void setLastDividend(java.lang.Float i)
Update the last dividend

Parameters:
i - new dividend

setListingDate

public void setListingDate(java.util.Date listing)
Update the date of listing

Parameters:
listing - New date teh celebrity was first listed

setLowestPrice

public void setLowestPrice(float i)
Update the lowest share price

Parameters:
i - new dividend

setName

public void setName(java.lang.String string)
Update the name.

Parameters:
string - New name

setPotentialDividend

public void setPotentialDividend(float i)
Update the potential dividend

Parameters:
i - new dividend

setSharePrice

public void setSharePrice(float i)
Update the share price

Parameters:
i - New share price.

setUpdated

public void setUpdated()
This celebrity recorded has just been updated. This will recalculate the internal values.


toString

public java.lang.String toString()
Generete a string representation.

Returns:
String based on Issue