|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.engine.resource.HighScoreHandler
public class HighScoreHandler
This class handles storing and retrieving a high score list of arbitrary length in an SQLite database. It supports name, score, and time columns.
Constructor Summary | |
---|---|
HighScoreHandler(int maxScores,
java.lang.String tableName,
java.io.File dbFile)
|
|
HighScoreHandler(int maxScores,
java.lang.String tableName,
java.lang.String dbFileName)
|
Method Summary | |
---|---|
java.lang.String[] |
getNames()
Returns the name column of the high score list in order from highest to lowest score. |
java.lang.Long[] |
getScores()
Returns the score column of the high score list in order from high to low. |
java.lang.Long[] |
getTimes()
Returns the time column of the high score list in order from highest to lowest score. |
void |
updateScores(java.lang.Long score)
If the input score belongs on list, adds a new score entry and drops the prior lowest score. |
void |
updateScores(long score,
long time)
If the input score belongs on list, adds a new score entry and drops the prior lowest score. |
void |
updateScores(java.lang.String name,
java.lang.Long score)
If the input score belongs on list, adds a new score entry and drops the prior lowest score. |
void |
updateScores(java.lang.String name,
java.lang.Long score,
java.lang.Long time)
If the input score belongs on list, adds a new score entry and drops the prior lowest score. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HighScoreHandler(int maxScores, java.lang.String tableName, java.io.File dbFile)
maxScores
- The maximum number of high scores stored.tableName
- Name of the SQLite table in which values will be stored.dbFile
- A File object of the SQLite database file.public HighScoreHandler(int maxScores, java.lang.String tableName, java.lang.String dbFileName)
maxScores
- The maximum number of high scores stored.tableName
- Name of the SQLite table in which values will be stored.dbFileName
- The file path of the SQLite database file.Method Detail |
---|
public void updateScores(java.lang.String name, java.lang.Long score, java.lang.Long time) throws SQLiteException
name
- Player name for high score list.score
- Long representing entry score.time
- Time at which score was set (typically milliseconds since
midnight, January 1, 1970 UTC).
SQLiteException
public void updateScores(java.lang.String name, java.lang.Long score) throws SQLiteException
name
- Player name for high score list.score
- Long representing entry score.
SQLiteException
public void updateScores(java.lang.Long score) throws SQLiteException
score
- Long representing entry score.
SQLiteException
public void updateScores(long score, long time) throws SQLiteException
score
- Long representing entry score.time
- Time at which score was set (typically milliseconds since
midnight, January 1, 1970 UTC).
SQLiteException
public java.lang.Long[] getScores()
public java.lang.String[] getNames()
public java.lang.Long[] getTimes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |