Betty v1.1.0

christophedelory.betty.xml
Class PhaseDetails

java.lang.Object
  extended by christophedelory.betty.xml.Child
      extended by christophedelory.betty.xml.IdDetails
          extended by christophedelory.betty.xml.PhaseDetails
All Implemented Interfaces:
HasRankModel, HasScoreModel, Serializable

public class PhaseDetails
extends IdDetails
implements HasRankModel, HasScoreModel

The championship's phase XML representation.

Version:
$Revision: 98 $
Author:
Christophe Delory
See Also:
PhaseBean, Serialized Form

Constructor Summary
PhaseDetails()
           
 
Method Summary
 void accept(XmlVisitor visitor)
          Accepts the specified XML visitor.
 void addEvent(EventDetails event)
          Adds an event to this phase.
 void addPlayerId(PlayerIdDetails playerId)
          Adds a player to this phase.
 EventDetails findEventById(String id)
          Searches for an event in this XML description that matches the input parameter.
 List<EventDetails> getEvents()
          Returns the list of events in this phase.
 List<PlayerIdDetails> getPlayerIds()
          Returns a list of players optionally attached to this phase.
 RankModelDetails getRankModel()
          Returns the rank processing model.
 ScoreModelDetails getScoreModel()
          Returns the score processing model.
 String getStartDateString()
          Returns the phase start date as a string.
 UsersDetails getUsers()
          Returns a list of users optionally attached to this phase.
 void setRankModel(RankModelDetails model)
          Initializes the rank processing model.
 void setScoreModel(ScoreModelDetails model)
          Initializes the score processing model.
 void setStartDateString(String date)
          Initializes the phase start date as a string.
 void setUsers(UsersDetails users)
          Initializes the list of users optionally attached to this phase.
 
Methods inherited from class christophedelory.betty.xml.IdDetails
addDescription, addLink, findDescriptionByLocale, findLinkByLocale, getDescriptions, getId, getLinks, setId
 
Methods inherited from class christophedelory.betty.xml.Child
getParent, getRoot, getRoot, getVersion, setParent, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhaseDetails

public PhaseDetails()
Method Detail

setStartDateString

public void setStartDateString(String date)
Initializes the phase start date as a string.
Format: "yyyy-MM-dd'T'HH:mm'Z'" (an ISO8601 date-time with explicit (Zulu) time zone).

Parameters:
date - a date as a string. May be null.
Since:
1.1.0
See Also:
getStartDateString()

getStartDateString

public String getStartDateString()
Returns the phase start date as a string.

Returns:
a date as a string. May be null.
Since:
1.1.0
See Also:
setStartDateString(java.lang.String)

setScoreModel

public void setScoreModel(ScoreModelDetails model)
Description copied from interface: HasScoreModel
Initializes the score processing model.

Specified by:
setScoreModel in interface HasScoreModel
Parameters:
model - a score processing model. May be null.
See Also:
HasScoreModel.getScoreModel()

getScoreModel

public ScoreModelDetails getScoreModel()
Description copied from interface: HasScoreModel
Returns the score processing model.

Specified by:
getScoreModel in interface HasScoreModel
Returns:
a score processing model. May be null.
See Also:
HasScoreModel.setScoreModel(ScoreModelDetails)

getRankModel

public RankModelDetails getRankModel()
Description copied from interface: HasRankModel
Returns the rank processing model.

Specified by:
getRankModel in interface HasRankModel
Returns:
a rank processing model. Shall not be null.
Throws:
IllegalStateException - if no rank processing model could be found in this instance or its hierarchy.
See Also:
HasRankModel.setRankModel(RankModelDetails)

setRankModel

public void setRankModel(RankModelDetails model)
Description copied from interface: HasRankModel
Initializes the rank processing model.

Specified by:
setRankModel in interface HasRankModel
Parameters:
model - a rank processing model. May be null.
See Also:
HasRankModel.getRankModel()

addPlayerId

public void addPlayerId(PlayerIdDetails playerId)
Adds a player to this phase.

Parameters:
playerId - a player. Shall not be null.
Throws:
NullPointerException - if playerId is null.
See Also:
getPlayerIds()

getPlayerIds

public List<PlayerIdDetails> getPlayerIds()
Returns a list of players optionally attached to this phase.

Returns:
a list of players. May be empty but not null.
See Also:
addPlayerId(PlayerIdDetails)

getUsers

public UsersDetails getUsers()
Returns a list of users optionally attached to this phase.

Returns:
a list of users. May be null.
See Also:
setUsers(UsersDetails)

setUsers

public void setUsers(UsersDetails users)
Initializes the list of users optionally attached to this phase.

Parameters:
users - a list of users. May be null.
See Also:
getUsers()

addEvent

public void addEvent(EventDetails event)
Adds an event to this phase.

Parameters:
event - an event. Shall not be null.
Throws:
NullPointerException - if event is null.
See Also:
getEvents()

getEvents

public List<EventDetails> getEvents()
Returns the list of events in this phase.

Returns:
a list of events. May be empty but not null.
See Also:
addEvent(EventDetails)

findEventById

public EventDetails findEventById(String id)
Searches for an event in this XML description that matches the input parameter.

Parameters:
id - an event identifier. Must not be null.
Returns:
an XML representation of the event, or null if none was found.
Throws:
NullPointerException - if id is null.
Since:
1.0.0

accept

public void accept(XmlVisitor visitor)
            throws Exception
Description copied from class: IdDetails
Accepts the specified XML visitor.

Overrides:
accept in class IdDetails
Parameters:
visitor - a visitor. Shall not be null.
Throws:
NullPointerException - if visitor is null.
Exception - if any error occurs during the visit.

© 2008-2009 Christophe Delory

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