Betty v1.1.0

christophedelory.betty.better
Class BetterRank

java.lang.Object
  extended by christophedelory.betty.better.BetterRank

public final class BetterRank
extends Object

The association between a better and its rank, based on the following statistics: total score and result.

Version:
$Revision$
Author:
Christophe Delory

Method Summary
static BetterRank addBet(List<BetterRank> betterRanks, LocalBet dbBet)
          Returns the better rank instance from the list that corresponds to the specified bet.
 int getResult()
          Returns the current total result.
 int getScore()
          Returns the current total score.
 LocalUser getUser()
          Returns the better EJB object.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addBet

public static BetterRank addBet(List<BetterRank> betterRanks,
                                LocalBet dbBet)
Returns the better rank instance from the list that corresponds to the specified bet. If not found in the list, creates it and adds it to the list.

Parameters:
betterRanks - a list of better ranks. Should not be null.
dbBet - a bet. Should not be null.
Returns:
a better rank. Should not be null.
Throws:
NullPointerException - if betterRanks is null.
NullPointerException - if dbBet is null.
EJBException - if any exception occurred during the execution of this method.

getUser

public LocalUser getUser()
Returns the better EJB object.

Returns:
a better EJB object. Shall not be null.

getScore

public int getScore()
Returns the current total score. There is no constraint on its value.

Returns:
a score value.

getResult

public int getResult()
Returns the current total result. There is no constraint on its value.

Returns:
a result value.

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a string representing this object.

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.