com.tootsville
Class Store

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerDatum
      extended by com.tootsville.Store
All Implemented Interfaces:
Serializable, Comparable<Object>

public class Store
extends SQLPeerDatum

A Storage Bin

A Store contains StoreItems. Note that my original interpretation of this was Store as in Storage, but it's come to also (usually) mean as in Place Of Shopping.

XXX this class is still based upon SQLPeerDatum, it should be migrated to DataRecord.

Author:
brpocock@star-hope.org
See Also:
GenericItemReference, Serialized Form

Field Summary
private  int id
          store's id
private  List<GenericItemReference> items
          the set of all items found in the store
private static long serialVersionUID
          Java serialisation unique ID
 
Constructor Summary
Store()
           
 
Method Summary
private  void addItem(GenericItemReference item)
          WRITEME: document this method (brpocock@star-hope.org, Aug 27, 2009)
 void flush()
          This is an overriding method.
static Store getByID(int storeID)
          Fetch up a store by its ID.
protected  String getCacheUniqueID()
          This is an overriding method.
 int getID()
           
 AbstractItem[] getItems()
          WRITEME: document this method (brpocock@star-hope.org, Aug 27, 2009)
protected  void set(ResultSet rs)
          This is an overriding method.
protected  void setID(int id1)
           
 org.json.JSONObject toJSON()
          This is an overriding method.
 
Methods inherited from class org.starhope.appius.sql.SQLPeerDatum
changed, compareTo, findInCache, 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
Java serialisation unique ID

See Also:
Constant Field Values

id

private int id
store's id


items

private final List<GenericItemReference> items
the set of all items found in the store

Constructor Detail

Store

public Store()
Method Detail

getByID

public static Store getByID(int storeID)
Fetch up a store by its ID.

Parameters:
storeID - WRITEME
Returns:
WRITEME

addItem

private void addItem(GenericItemReference item)
WRITEME: document this method (brpocock@star-hope.org, Aug 27, 2009)

Parameters:
item - WRITEME

flush

public void flush()
This is an overriding method.

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

getCacheUniqueID

protected String getCacheUniqueID()
This is an overriding method.

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

getID

public int getID()
Returns:
the id

getItems

public AbstractItem[] getItems()
WRITEME: document this method (brpocock@star-hope.org, Aug 27, 2009)

Returns:
WRITEME

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)

setID

protected void setID(int id1)
Parameters:
id1 - the id to set

toJSON

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

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