org.starhope.appius.game
Class StoreItem

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerDatum
      extended by org.starhope.appius.game.StoreItem
All Implemented Interfaces:
Serializable, ItemCreationTemplate

public class StoreItem
extends SQLPeerDatum
implements ItemCreationTemplate

WRITEME: The documentation for this type (StoreItem) is incomplete. (brpocock, Aug 19, 2009)

Author:
brpocock
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
          TODO: document this field (brpocock, Oct 13, 2009) serialVersionUID (long)
 
Fields inherited from class org.starhope.appius.sql.SQLPeerDatum
hackyDatabaseConnection
 
Constructor Summary
StoreItem()
           
 
Method Summary
 void flush()
          This is an overriding method.
static StoreItem getByID(int id)
           
protected  String getCacheUniqueID()
           
 String getDescription()
          Get the user-visible description of the item
 int getItemID()
           
 BigDecimal getPrice()
           
 String getTitle()
           
protected  void set(ResultSet rs)
          This is an overriding method.
 void setItemID(int itemID1)
           
 void setPrice(BigDecimal price1)
           
 void setTitle(String title1)
           
 org.json.JSONObject toJSON()
          This is an overriding method.
 
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum
changed, findInCache, get, prepareX, prepareX, saveInCache, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
TODO: document this field (brpocock, Oct 13, 2009) serialVersionUID (long)

See Also:
Constant Field Values
Constructor Detail

StoreItem

public StoreItem()
Method Detail

getByID

public static StoreItem getByID(int id)
                         throws NotFoundException
Parameters:
id - WRITEME
Returns:
WRITEME
Throws:
NotFoundException - WRITEME

flush

public void flush()
This is an overriding method.

Specified by:
flush in class SQLPeerDatum
See Also:
SQLPeerDatum.flush()

getCacheUniqueID

protected String getCacheUniqueID()
Specified by:
getCacheUniqueID in class SQLPeerDatum
Returns:
The local (Stringified) version of an unique ID; usually the database ID column
See Also:
SQLPeerDatum.getCacheUniqueID()

getDescription

public String getDescription()
Description copied from interface: ItemCreationTemplate
Get the user-visible description of the item

Specified by:
getDescription in interface ItemCreationTemplate
Returns:
the database description of the item
See Also:
ItemCreationTemplate.getDescription()

getItemID

public int getItemID()
Specified by:
getItemID in interface ItemCreationTemplate
Returns:
the itemID
See Also:
ItemCreationTemplate.getItemID()

getPrice

public BigDecimal getPrice()
Specified by:
getPrice in interface ItemCreationTemplate
Returns:
the price
See Also:
ItemCreationTemplate.getPrice()

getTitle

public String getTitle()
Specified by:
getTitle in interface ItemCreationTemplate
Returns:
the title
See Also:
ItemCreationTemplate.getTitle()

set

protected void set(ResultSet rs)
            throws SQLException
This is an overriding method.

Specified by:
set in class SQLPeerDatum
Parameters:
rs - The result of an SQL query, with the cursor already pointed at the row describing this specific instance of the object.
Throws:
SQLException - if the database fails somehow
See Also:
SQLPeerDatum.set(java.sql.ResultSet)

setItemID

public void setItemID(int itemID1)
Specified by:
setItemID in interface ItemCreationTemplate
Parameters:
itemID1 - the itemID to set
See Also:
ItemCreationTemplate.setItemID(int)

setPrice

public void setPrice(BigDecimal price1)
Specified by:
setPrice in interface ItemCreationTemplate
Parameters:
price1 - the price to set
See Also:
ItemCreationTemplate.setPrice(java.math.BigDecimal)

setTitle

public void setTitle(String title1)
Specified by:
setTitle in interface ItemCreationTemplate
Parameters:
title1 - the title to set
See Also:
ItemCreationTemplate.setTitle(java.lang.String)

toJSON

public org.json.JSONObject toJSON()
This is an overriding method.

Specified by:
toJSON in interface ItemCreationTemplate
Overrides:
toJSON in class SQLPeerDatum
Returns:
This object's data, serialized into JSON form.
See Also:
SQLPeerDatum.toJSON()