|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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()
WRITEME |
protected |
Currency(int id)
|
private |
Currency(ResultSet resultSet)
|
Method Summary | |
---|---|
protected void |
cache(ResultSet set)
This method caches into the internal "enumeration" hashmap the results of an SQL query specific to this SQLPeerEnum class of object. |
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)
|
protected String |
getCacheUniqueID()
This is an overriding method. |
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 |
---|
doRealCacheResetStatic, equals, equals, get, get, getEnumeration, getID, getID, getString, getString, hashCode, invalidateCache, invalidateCaches, prepCache, resetCache, set, set, toJSON, toString |
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
---|
changed, findInCache, get, saveInCache |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, 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 foundprotected void cache(ResultSet set) throws SQLException
SQLPeerEnum
cache
in class SQLPeerEnum
set
- The ResultSet from the SQL query
SQLException
- if anything goes wrong from the querySQLPeerEnum.cache(java.sql.ResultSet)
public void flush()
flush
in class SQLPeerDatum
SQLPeerDatum.flush()
protected String getCacheUniqueID()
getCacheUniqueID
in class SQLPeerEnum
SQLPeerDatum.getCacheUniqueID()
public String getCode()
protected PreparedStatement getStatement(Connection connection)
SQLPeerEnum
getStatement
in class SQLPeerEnum
connection
- WRITEME
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
o
- The JSON data to be used to set the value of this
objectCastsToJSON.set(org.json.JSONObject)
protected void set(ResultSet rs)
set
in class SQLPeerDatum
rs
- The result of an SQL query, with the cursor already
pointed at the row describing this specific instance
of the object.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 AppiusCharacter.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 |