|
||||||||||
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 PublicCertificateI
public java.lang.String getUniqueId()
PublicCertificateI
getUniqueId
in interface PublicCertificateI
public int getIndexInCompany()
getIndexInCompany
in interface PublicCertificateI
public static PublicCertificateI getByUniqueId(java.lang.String certId)
public void moveTo(MoveableHolder newHolder)
moveTo
in interface Moveable
public Portfolio getPortfolio()
getPortfolio
in interface Certificate
public MoveableHolder getHolder()
getHolder
in interface Moveable
public boolean isPresidentShare()
isPresidentShare
in interface PublicCertificateI
public int getShares()
getShares
in interface PublicCertificateI
public int getShare()
getShare
in interface PublicCertificateI
public java.lang.String getName()
getName
in interface Certificate
getName
in interface Moveable
public void setInitiallyAvailable(boolean initiallyAvailable)
PublicCertificateI
setInitiallyAvailable
in interface PublicCertificateI
public boolean isInitiallyAvailable()
isInitiallyAvailable
in interface PublicCertificateI
b
- public float getCertificateCount()
getCertificateCount
in interface PublicCertificateI
public void setCertificateCount(float certificateCount)
setCertificateCount
in interface PublicCertificateI
public void setPortfolio(Portfolio portfolio)
setPortfolio
in interface PublicCertificateI
portfolio
- public void setPresident(boolean b)
setPresident
in interface PublicCertificateI
b
- public PublicCompanyI getCompany()
getCompany
in interface PublicCertificateI
public void setCompany(PublicCompanyI companyI)
setCompany
in interface PublicCertificateI
companyI
- public java.lang.String getTypeId()
getTypeId
in interface PublicCertificateI
protected java.lang.Object clone()
clone
in class java.lang.Object
public PublicCertificateI copy()
PublicCertificateI
copy
in interface PublicCertificateI
public boolean equals(PublicCertificateI cert)
equals
in interface PublicCertificateI
cert
- 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 |