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)
Database
setActiveProfile
in interface Database
activeProfile
- Which profileId the user logged in as.public void shutdown()
public void store(Player player)
Database
public Player getPlayer(int id)
Database
public Player getPlayer(java.lang.String name)
Database
public void store(FinishedMatch finishedMatch)
Database
public double[] getAllRatingsByDate()
Database
getAllRatingsByDate
in interface Database
public void updateOpponent(Player p)
Database
updateOpponent
in interface Database
p
- The Player to updatepublic java.util.List<FinishedMatch> getFinishedMatches(int pid)
Database
getFinishedMatches
in interface Database
pid
- The playerid to query.public java.util.List<GroupOfPlayers> getGroupsOfPlayers()
Database
getGroupsOfPlayers
in interface Database
public void store(java.util.List<GroupOfPlayers> groupList)
Database
GroupOfPlayers
's dirty flag to save disk accesses.