|
Betty v1.1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchristophedelory.betty.model.rank.PlayerRank
public final class PlayerRank
The association between a player and its rank, based on the following statistics: total score and result, result difference with other players.
Method Summary | |
---|---|
LocalPlayer |
getPlayer()
Returns the player EJB object. |
static PlayerRank |
getPlayerRank(List<PlayerRank> playerRanks,
LocalPlayer dbPlayer)
Returns the player rank instance from the list that corresponds to the specified player. |
int |
getRank()
Returns the current player rank value. |
int |
getResult()
Returns the current total result. |
int |
getResultDifference()
Returns the current result difference. |
int |
getScore()
Returns the current score. |
void |
setRank(int rank)
Initializes the player rank value. |
String |
toString()
Returns a string representation of this object. |
PlayerIdDetails |
toXml(Locale[] locales)
Returns an XML representation of this object. |
void |
update(LocalPlayerScore dbPlayerScore)
Updates the total score and result from the specified player score and result. |
void |
update(LocalPlayerScore dbPlayerScore,
LocalPlayerScore dbOpponentPlayerScore)
Updates the result difference based on the two player results. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static PlayerRank getPlayerRank(List<PlayerRank> playerRanks, LocalPlayer dbPlayer)
playerRanks
- a list of player ranks. Should not be null
.dbPlayer
- a player. Should not be null
.
null
.
NullPointerException
- if playerRanks
is null
.
NullPointerException
- if dbPlayer
is null
.
EJBException
- if any exception occured during the execution of this method.public LocalPlayer getPlayer()
null
.public int getRank()
setRank(int)
public void setRank(int rank)
rank
- a rank value.getRank()
public int getScore()
public int getResult()
public int getResultDifference()
public void update(LocalPlayerScore dbPlayerScore)
dbPlayerScore
- a player score EJB object.
NullPointerException
- if dbPlayerScore
is null
.
EJBException
- if any exception occured during the execution of this method.update(LocalPlayerScore,LocalPlayerScore)
public void update(LocalPlayerScore dbPlayerScore, LocalPlayerScore dbOpponentPlayerScore)
dbPlayerScore
- a player score EJB object.dbOpponentPlayerScore
- a player score EJB object.
NullPointerException
- if dbPlayerScore
is null
.
NullPointerException
- if dbOpponentPlayerScore
is null
.
EJBException
- if any exception occured during the execution of this method.update(LocalPlayerScore)
public PlayerIdDetails toXml(Locale[] locales)
locales
- the preferred locales that the caller will accept content in. Should not be null
.
NullPointerException
- if locales
is null
.
EJBException
- if any exception occured during the execution of this method.public String toString()
toString
in class Object
|
© 2008-2009 Christophe Delory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |