celeboss.data
Class LeagueMember

java.lang.Object
  extended byceleboss.data.LeagueMember
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable

public class LeagueMember
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

This is an immutable class that represents a member of a mini league.

Version:
1.0
Author:
bevans
See Also:
Serialized Form

Constructor Summary
LeagueMember(java.lang.String newName, int id, int posn, int lastPosn, int newWorth, float newGain, int newMills)
          Create a new league member.
 
Method Summary
 int compareTo(java.lang.Object arg0)
          Compare this object with another.
 boolean equals(java.lang.Object o)
          Is this object equal to this league member based on name.
 java.lang.Float getGain()
          Return the percentage gain
 java.util.List getHistory()
          Get the history for this league member.
 java.lang.Integer getLastPosition()
          Get the last position for this member
 java.lang.Integer getMillions()
          Get the current number of millions this members has
 java.lang.String getName()
          Get the name of the member
 java.lang.Integer getPosition()
          Current position in the league
 int getUserId()
           
 java.lang.Integer getWorth()
          Get the current worth
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeagueMember

public LeagueMember(java.lang.String newName,
                    int id,
                    int posn,
                    int lastPosn,
                    int newWorth,
                    float newGain,
                    int newMills)
Create a new league member.

Parameters:
newName - Nmae of the league member.
id - User account id.
posn - Current position
lastPosn - Last position
newWorth - Current worth
newGain - Percentage gain over last 24 hours
newMills - Millions cached by member
Method Detail

compareTo

public int compareTo(java.lang.Object arg0)
Compare this object with another.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
arg0 - Object to compare with
Returns:
Rating based on the position value.
See Also:
Comparable.compareTo(java.lang.Object)

equals

public boolean equals(java.lang.Object o)
Is this object equal to this league member based on name.

Parameters:
o - Object to compare against
Returns:
Is it equals
See Also:
Object.equals(java.lang.Object)

getGain

public java.lang.Float getGain()
Return the percentage gain

Returns:
Percentage value.

getHistory

public java.util.List getHistory()
Get the history for this league member.

Returns:
List of LeaguePositino instances

getLastPosition

public java.lang.Integer getLastPosition()
Get the last position for this member

Returns:
Integer of last position

getMillions

public java.lang.Integer getMillions()
Get the current number of millions this members has

Returns:
NUmber of millions

getName

public java.lang.String getName()
Get the name of the member

Returns:
Name of the member

getPosition

public java.lang.Integer getPosition()
Current position in the league

Returns:
Integer value

getUserId

public int getUserId()
Returns:
Returns the userId.

getWorth

public java.lang.Integer getWorth()
Get the current worth

Returns:
Money value