com.tractrac.clientmodule
Class Race

java.lang.Object
  extended by com.tractrac.clientmodule.details.Attachments
      extended by com.tractrac.clientmodule.details.IdBase
          extended by com.tractrac.clientmodule.details.IdBaseNamed
              extended by com.tractrac.clientmodule.Race

public class Race
extends IdBaseNamed

Encapsulates data related to a specific Race of a TracTrac Event.

An instance of this class has a unique id and a name. Furthermore it has a number of so-called Race Competitors, one for each Competitor of the event, that is used to wrap Competitor data that may be different from Race to Race.

Custom data may be attached to each Race instance.

Use Event.addRace(java.util.UUID, java.lang.String) to create a new Race.

Version:
2.0
Author:
TracTrac
See Also:
Event, Competitor, RaceCompetitor

Method Summary
 Event getEvent()
          Returns the event to which this Race is associated.
 RaceCompetitor getRaceCompetitor(Competitor comp)
          Looks up a Race Competitor based on a given Competitor.
 java.util.Collection<RaceCompetitor> getRaceCompetitorList()
          Returns a read-only collection of the race competitors of this event.
static AttKey newAttKey()
          Creates a new (static) key to be used to set/get custom data related to races.
 
Methods inherited from class com.tractrac.clientmodule.details.IdBaseNamed
getName, toString
 
Methods inherited from class com.tractrac.clientmodule.details.IdBase
equals, getId, hashCode
 
Methods inherited from class com.tractrac.clientmodule.details.Attachments
getAttachment, setAttachment
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

newAttKey

public static AttKey newAttKey()
Creates a new (static) key to be used to set/get custom data related to races.

Returns:
a new key.

getEvent

public Event getEvent()
Returns the event to which this Race is associated.

Returns:
the event to which this Race is associated (never null).

getRaceCompetitorList

public java.util.Collection<RaceCompetitor> getRaceCompetitorList()
Returns a read-only collection of the race competitors of this event.

Returns:
a read-only collection of the race competitors of this event.

getRaceCompetitor

public RaceCompetitor getRaceCompetitor(Competitor comp)
Looks up a Race Competitor based on a given Competitor.

Parameters:
comp - the Competitor to look up.
Returns:
the Race Competitor associated with the Competitor, or null if not found.