|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.appius.util.ManagedReferenceHolder
org.starhope.appius.sql.SQLPeerDatum
org.starhope.appius.sql.SQLPeerEnum
org.starhope.appius.mb.Currency
public class Currency
Field Summary | |
---|---|
private String |
code
The ISO-4217 currency code (three letters); "USD" is U.S. |
private static long |
serialVersionUID
|
private String |
symbol
The display character sequence. |
Fields inherited from class org.starhope.appius.sql.SQLPeerEnum |
---|
enumeration, instance |
Constructor Summary | |
---|---|
private |
Currency()
|
protected |
Currency(int id)
|
private |
Currency(ResultSet resultSet)
|
Method Summary | |
---|---|
void |
flush()
|
static Currency |
get_USD()
This is a quick "semantic sugar" to pick up U.S. |
static Currency |
get(org.json.JSONObject object)
|
static Currency |
get(String id)
|
static Currency |
getByCode(String string)
|
String |
getCode()
Get the three-character (ISO-4217) currency code. |
protected PreparedStatement |
getStatement(Connection connection)
WRITEME: document this method (brpocock, Aug 14, 2009) |
String |
getSymbol()
|
void |
set(org.json.JSONObject o)
|
protected void |
set(ResultSet rs)
|
void |
setCode(String newCode)
Change the currency code for this instance. |
void |
setSymbol(String newSymbol)
Set the user-visible displayed symbol of this currency. |
Methods inherited from class org.starhope.appius.sql.SQLPeerEnum |
---|
cache, getCacheUniqueID, getID, getID, getString, getString, prepCache, toJSON |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, prepare, prepare, saveInCache |
Methods inherited from class org.starhope.appius.util.ManagedReferenceHolder |
---|
deref, setRef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private String code
private String symbol
Constructor Detail |
---|
private Currency()
protected Currency(int id)
id
- The integral ID number for the type of currency to be
instantiatedprivate Currency(ResultSet resultSet)
resultSet
- the SQL row from which to instantiate this
currency objectMethod Detail |
---|
public static Currency get(org.json.JSONObject object) throws RuntimeException, NotFoundException, org.json.JSONException
object
- the JSON data describing the currency wanted
org.json.JSONException
- if the JSON data is badly-formed
NotFoundException
- if the object isn't found in the
database
RuntimeException
- if something else bad happenspublic static Currency get(String id) throws RuntimeException, NotFoundException
id
- database ID
NotFoundException
- if it's not found in the database
RuntimeException
- if something else wonky were to happenpublic static Currency get_USD()
public static Currency getByCode(String string) throws NotFoundException
string
- ISO-4217 currency code
NotFoundException
- if it can't be foundpublic void flush()
flush
in class SQLPeerDatum
SQLPeerDatum.flush()
public String getCode()
protected PreparedStatement getStatement(Connection connection)
SQLPeerEnum
getStatement
in class SQLPeerEnum
SQLPeerEnum.getStatement(java.sql.Connection)
public String getSymbol()
Returns the currency symbol for user presentation
of prices.
public void set(org.json.JSONObject o)
set
in class SQLPeerDatum
CastsToJSON.set(org.json.JSONObject)
protected void set(ResultSet rs)
set
in class SQLPeerDatum
SQLPeerDatum.set(java.sql.ResultSet)
public void setCode(String newCode) throws DataException
newCode
- The new currency code to be set (ISO-4217,
uppercase, e.g. "USD")
DataException
- if the specification does not consist of
three BraqueCharacter.UPPERCASE_LETTER characters.public void setSymbol(String newSymbol) throws DataException
newSymbol
- The new symbol string to be used for this
currency
DataException
- if the new symbol string is not supplied,
or is more than 5 characters long
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |