|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrails.game.PublicCertificate
public class PublicCertificate
| Field Summary | |
|---|---|
protected java.lang.String |
certId
A key identifying the certificate's unique ID |
protected float |
certificateCount
Count against certificate limits |
protected static java.util.Map<java.lang.String,PublicCertificateI> |
certMap
A map allowing to find certificates by unique id |
protected java.lang.String |
certTypeId
A key identifying the certificate's unique type |
protected PublicCompanyI |
company
From which public company is this a certificate |
protected int |
indexInCompany
Index within company (to be maintained in the IPO) |
protected boolean |
initiallyAvailable
Availability at the start of the game |
protected static org.apache.log4j.Logger |
log
|
protected Portfolio |
portfolio
Current holder of the certificate |
protected boolean |
president
President's certificate? |
protected int |
shares
Share percentage represented by this certificate |
| Fields inherited from interface rails.game.move.Moveable |
|---|
AT_END |
| Constructor Summary | |
|---|---|
PublicCertificate(int shares,
boolean president,
boolean available,
float certificateCount,
int index)
|
|
PublicCertificate(PublicCertificateI oldCert)
|
|
| Method Summary | |
|---|---|
protected java.lang.Object |
clone()
|
PublicCertificateI |
copy()
Clone this certificate |
boolean |
equals(PublicCertificateI cert)
Two certificates are "equal" if they both belong to the same company, represent the same share percentage, and are not a president share. |
static PublicCertificateI |
getByUniqueId(java.lang.String certId)
|
float |
getCertificateCount()
|
PublicCompanyI |
getCompany()
|
MoveableHolder |
getHolder()
|
int |
getIndexInCompany()
|
java.lang.String |
getName()
Get the name of a certificate. |
Portfolio |
getPortfolio()
|
int |
getShare()
Get the percentage of ownership that this certificate represents. |
int |
getShares()
Get the number of shares that this certificate represents. |
java.lang.String |
getTypeId()
|
java.lang.String |
getUniqueId()
Set the certificate's unique ID |
boolean |
isInitiallyAvailable()
|
boolean |
isPresidentShare()
|
void |
moveTo(MoveableHolder newHolder)
|
void |
setCertificateCount(float certificateCount)
|
void |
setCompany(PublicCompanyI companyI)
|
void |
setInitiallyAvailable(boolean initiallyAvailable)
Get the current price of this certificate. |
void |
setPortfolio(Portfolio portfolio)
|
void |
setPresident(boolean b)
|
void |
setUniqueId(java.lang.String name,
int index)
Set the certificate's unique ID, for use in deserializing |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected PublicCompanyI company
protected int shares
protected boolean president
protected float certificateCount
protected boolean initiallyAvailable
protected Portfolio portfolio
protected java.lang.String certTypeId
protected java.lang.String certId
protected int indexInCompany
protected static java.util.Map<java.lang.String,PublicCertificateI> certMap
protected static org.apache.log4j.Logger log
| Constructor Detail |
|---|
public PublicCertificate(int shares,
boolean president,
boolean available,
float certificateCount,
int index)
public PublicCertificate(PublicCertificateI oldCert)
| Method Detail |
|---|
public void setUniqueId(java.lang.String name,
int index)
PublicCertificateI
setUniqueId in interface PublicCertificateIpublic java.lang.String getUniqueId()
PublicCertificateI
getUniqueId in interface PublicCertificateIpublic int getIndexInCompany()
getIndexInCompany in interface PublicCertificateIpublic static PublicCertificateI getByUniqueId(java.lang.String certId)
public void moveTo(MoveableHolder newHolder)
moveTo in interface Moveablepublic Portfolio getPortfolio()
getPortfolio in interface Certificatepublic MoveableHolder getHolder()
getHolder in interface Moveablepublic boolean isPresidentShare()
isPresidentShare in interface PublicCertificateIpublic int getShares()
getShares in interface PublicCertificateIpublic int getShare()
getShare in interface PublicCertificateIpublic java.lang.String getName()
getName in interface CertificategetName in interface Moveablepublic void setInitiallyAvailable(boolean initiallyAvailable)
PublicCertificateI
setInitiallyAvailable in interface PublicCertificateIpublic boolean isInitiallyAvailable()
isInitiallyAvailable in interface PublicCertificateIb - public float getCertificateCount()
getCertificateCount in interface PublicCertificateIpublic void setCertificateCount(float certificateCount)
setCertificateCount in interface PublicCertificateIpublic void setPortfolio(Portfolio portfolio)
setPortfolio in interface PublicCertificateIportfolio - public void setPresident(boolean b)
setPresident in interface PublicCertificateIb - public PublicCompanyI getCompany()
getCompany in interface PublicCertificateIpublic void setCompany(PublicCompanyI companyI)
setCompany in interface PublicCertificateIcompanyI - public java.lang.String getTypeId()
getTypeId in interface PublicCertificateIprotected java.lang.Object clone()
clone in class java.lang.Objectpublic PublicCertificateI copy()
PublicCertificateI
copy in interface PublicCertificateIpublic boolean equals(PublicCertificateI cert)
equals in interface PublicCertificateIcert - Public company certificate to compare with.
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||