|
||||||||||
| 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
public abstract class SQLPeerEnum
This is a class for infrequently-changed objects that are enumerated types referenced by integer ID columns. Things like the set of available avatar classes fall into this category.
| Field Summary | |
|---|---|
protected static ConcurrentHashMap<Class<? extends SQLPeerEnum>,ConcurrentHashMap<Integer,String>> |
enumeration
enumeration of all possible values |
private static ConcurrentHashMap<Class<? extends SQLPeerEnum>,Integer> |
hasCached
Index of which classes have been cached already. |
protected int |
instance
instance ID |
private static HashSet<Class<? extends SQLPeerEnum>> |
knownChildren
WRITEME: document this field (brpocock, Dec 11, 2009) knownChildren (SQLPeerEnum) |
private static long |
serialVersionUID
TODO: document this field (brpocock, Oct 13, 2009) serialVersionUID (long) |
| Constructor Summary | |
|---|---|
|
SQLPeerEnum(Class<? extends SQLPeerEnum> klass)
TODO |
protected |
SQLPeerEnum(Class<? extends SQLPeerEnum> klass,
int id)
TODO |
| 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. |
private void |
doRealCacheReset()
Actually flush the cache for all SQLPeerEnums |
static void |
doRealCacheResetStatic()
TODO: document this method (brpocock, Dec 11, 2009) |
boolean |
equals(Object o)
This is an overriding method. |
boolean |
equals(SQLPeerEnum o)
|
static SQLPeerEnum |
get(Class<? extends SQLPeerEnum> klass,
int id)
TODO: document this method (brpocock, Nov 19, 2009) |
static SQLPeerEnum |
get(Class<? extends SQLPeerEnum> klass,
String str)
TODO: document this method (brpocock, Nov 19, 2009) |
protected String |
getCacheUniqueID()
This is an overriding method. |
protected ConcurrentHashMap<Integer,String> |
getEnumeration()
|
int |
getID()
WRITEME: document this method (brpocock, Aug 14, 2009) |
int |
getID(String s)
WRITEME: document this method (brpocock, Jul 8, 2009) |
protected abstract PreparedStatement |
getStatement(Connection connection)
WRITEME: document this method (brpocock, Aug 14, 2009) |
String |
getString()
TODO: document this method (brpocock, Oct 13, 2009) |
String |
getString(int id)
WRITEME: document this method (brpocock, Jul 8, 2009) |
int |
hashCode()
This is an overriding method. |
static void |
invalidateCache()
TODO: document this method (brpocock, Dec 11, 2009) |
static void |
invalidateCaches()
TODO: document this method (brpocock, Dec 11, 2009) |
protected void |
prepCache()
TODO: document this method (brpocock, Oct 13, 2009) |
private static void |
registerClass(Class<? extends SQLPeerEnum> klass)
TODO: document this method (brpocock, Dec 11, 2009) |
void |
resetCache()
TODO: document this method (brpocock, Oct 13, 2009) |
void |
set(int id)
TODO: document this method (brpocock, Nov 19, 2009) |
void |
set(String str)
TODO: document this method (brpocock, Nov 19, 2009) |
org.json.JSONObject |
toJSON()
This is an overriding method. |
String |
toString()
Create a stringified version of this enumeration. |
| Methods inherited from class org.starhope.appius.sql.SQLPeerDatum |
|---|
changed, findInCache, flush, get, saveInCache, set, set |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final ConcurrentHashMap<Class<? extends SQLPeerEnum>,ConcurrentHashMap<Integer,String>> enumeration
private static final ConcurrentHashMap<Class<? extends SQLPeerEnum>,Integer> hasCached
private static HashSet<Class<? extends SQLPeerEnum>> knownChildren
private static final long serialVersionUID
protected int instance
| Constructor Detail |
|---|
public SQLPeerEnum(Class<? extends SQLPeerEnum> klass)
klass - WRITEME
protected SQLPeerEnum(Class<? extends SQLPeerEnum> klass,
int id)
klass - WRITEMEid - the specific ID| Method Detail |
|---|
public static void doRealCacheResetStatic()
public static SQLPeerEnum get(Class<? extends SQLPeerEnum> klass,
int id)
klass - WRITEMEid - WRITEME
public static SQLPeerEnum get(Class<? extends SQLPeerEnum> klass,
String str)
klass - WRITEME WRITEMEstr - WRITEME WRITEME
public static void invalidateCache()
public static void invalidateCaches()
private static void registerClass(Class<? extends SQLPeerEnum> klass)
klass - WRITEME
protected void cache(ResultSet set)
throws SQLException
set - The ResultSet from the SQL query
SQLException - if anything goes wrong from the queryprivate void doRealCacheReset()
public boolean equals(Object o)
equals in class ObjectObject.equals(java.lang.Object)public boolean equals(SQLPeerEnum o)
o - The other type
Object.equals(Object)protected String getCacheUniqueID()
getCacheUniqueID in class SQLPeerDatumSQLPeerDatum.getCacheUniqueID()protected ConcurrentHashMap<Integer,String> getEnumeration()
public int getID()
public int getID(String s)
s - the string value for which to search
protected abstract PreparedStatement getStatement(Connection connection)
connection - WRITEME
public String getString()
public String getString(int id)
id - The value
public int hashCode()
hashCode in class ObjectObject.hashCode()protected void prepCache()
public void resetCache()
public void set(int id)
id - WRITEMEpublic void set(String str)
str - WRITEMEpublic org.json.JSONObject toJSON()
toJSON in class SQLPeerDatumSQLPeerDatum.toJSON()public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||