org.dartra.standard
Class StandardTeam

java.lang.Object
  extended byorg.dartra.standard.PersistentObject
      extended byorg.dartra.standard.StandardPlayer
          extended byorg.dartra.standard.StandardTeam
All Implemented Interfaces:
Persistent, Player, Team

public class StandardTeam
extends StandardPlayer
implements Team

Standard implementation of the Team interface.

Author:
Erwin Vervaet

Constructor Summary
StandardTeam(User user, int handicap, Player[] players)
           
 
Method Summary
 Player getCurrentPlayer()
          Get the currently active player of this team, in the context of the game in which this team is participating.
 Player getPlayer(int index)
          Get the specified member of this team.
 java.util.Vector getPlayers()
          Returns the list of players that are members of this team.
 void setGame(Game game)
          Set the game this user is participating in.
 java.lang.String toString()
           
 
Methods inherited from class org.dartra.standard.StandardPlayer
getDartsSet, getGame, getHandicap, getTeam, getUser, setTeam
 
Methods inherited from class org.dartra.standard.PersistentObject
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dartra.framework.Player
getDartsSet, getGame, getHandicap, getTeam, getUser, setTeam
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Constructor Detail

StandardTeam

public StandardTeam(User user,
                    int handicap,
                    Player[] players)
Method Detail

getPlayers

public java.util.Vector getPlayers()
Description copied from interface: Team

Returns the list of players that are members of this team. The returned list contains Player objects.

Specified by:
getPlayers in interface Team

getPlayer

public Player getPlayer(int index)
Description copied from interface: Team

Get the specified member of this team.

Specified by:
getPlayer in interface Team

getCurrentPlayer

public Player getCurrentPlayer()
Description copied from interface: Team

Get the currently active player of this team, in the context of the game in which this team is participating.

Specified by:
getCurrentPlayer in interface Team

setGame

public void setGame(Game game)
Description copied from interface: Player

Set the game this user is participating in.

Implementations should make sure that it is not possible to change the game a user is participating in! This is particularly imporant for matches. The player will participate first and foremost in the match. He or she will also play the games of that match. However, that should have no impact on the game the player is linked with, which will be the match itself.

Specified by:
setGame in interface Player
Overrides:
setGame in class StandardPlayer

toString

public java.lang.String toString()
Overrides:
toString in class StandardPlayer