public class DatabaseImpl extends java.lang.Object implements Database
| Constructor and Description |
|---|
DatabaseImpl() |
| Modifier and Type | Method and Description |
|---|---|
double[] |
getAllRatingsByDate()
Return an array of your ratings ordered by date.
|
java.util.List<FinishedMatch> |
getFinishedMatches(int pid)
Get a List of matches that you have played against this player.
|
java.util.List<GroupOfPlayers> |
getGroupsOfPlayers()
Get all of the GroupOfPlayers
|
Player |
getPlayer(int id)
Find this player based on his id
|
Player |
getPlayer(java.lang.String name)
Find this Player based on his name
|
void |
setActiveProfile(int activeProfile)
Set the active Profile.
|
void |
setURL(java.lang.String url)
Set the URL we use to connect to the database.
|
void |
shutdown() |
void |
store(FinishedMatch finishedMatch)
Store this FinishedMatch to the database
|
void |
store(java.util.List<GroupOfPlayers> groupList)
Store all of the GroupOfPlayers.
|
void |
store(Player player)
Write this player to the database
|
void |
updateOpponent(Player p)
Update the opponent with the data that we have.
|
public void setURL(java.lang.String url)
url - The test harness sets this to "mem" to use an in-memory database.public void setActiveProfile(int activeProfile)
DatabasesetActiveProfile in interface DatabaseactiveProfile - Which profileId the user logged in as.public void shutdown()
public void store(Player player)
Databasepublic Player getPlayer(int id)
Databasepublic Player getPlayer(java.lang.String name)
Databasepublic void store(FinishedMatch finishedMatch)
Databasepublic double[] getAllRatingsByDate()
DatabasegetAllRatingsByDate in interface Databasepublic void updateOpponent(Player p)
DatabaseupdateOpponent in interface Databasep - The Player to updatepublic java.util.List<FinishedMatch> getFinishedMatches(int pid)
DatabasegetFinishedMatches in interface Databasepid - The playerid to query.public java.util.List<GroupOfPlayers> getGroupsOfPlayers()
DatabasegetGroupsOfPlayers in interface Databasepublic void store(java.util.List<GroupOfPlayers> groupList)
DatabaseGroupOfPlayers's dirty flag to save disk accesses.