Source code: com/clra/rowing/ParticipantSnapshot.java
1 /*
2 * Copyright (c) Carnegie Lake Rowing Association 2002. All rights reserved.
3 * Distributed under the GPL license. See doc/COPYING.
4 * $RCSfile: ParticipantSnapshot.java,v $
5 * $Date: 2003/02/26 03:38:45 $
6 * $Revision: 1.3 $
7 */
8
9 package com.clra.rowing;
10
11 import com.clra.member.MemberSnapshot;
12
13 /**
14 * Read-only information about a member's participation in rowing session.
15 *
16 * @version $Revision: 1.3 $ $Date: 2003/02/26 03:38:45 $
17 * @author <a href="mailto:rphall@pluto.njcc.com">Rick Hall</a>
18 */
19 public class ParticipantSnapshot {
20
21 private final Integer rowingId;
22 private final Integer memberId;
23 private final Integer participantId;
24 private final SeatPreference preference;
25 private final Integer replacesId;
26 private final Integer initialSeatId;
27 private final Integer finalSeatId;
28 private final Attendance attendance;
29
30 public ParticipantSnapshot( Integer memberId, Integer rowingId,
31 Integer participantId, SeatPreference preference,
32 Integer replacesId, Integer initialSeatId,
33 Integer finalSeatId, Attendance attendance ) {
34
35 // Preconditions
36 if ( rowingId == null ) {
37 throw new IllegalArgumentException( "null session" );
38 }
39 if ( memberId == null ) {
40 throw new IllegalArgumentException( "null member" );
41 }
42 if ( participantId == null ) {
43 throw new IllegalArgumentException( "null participant id" );
44 }
45
46 this.memberId = memberId;
47 this.rowingId = rowingId;
48 this.participantId = participantId;
49 this.preference = preference;
50 this.replacesId = replacesId;
51 this.initialSeatId = initialSeatId;
52 this.finalSeatId = finalSeatId;
53 this.attendance = attendance;
54
55 } // ctor(..)
56
57 /**
58 * Return the primary key of the member associated with this participant.
59 */
60 public Integer getMemberId() {
61 return this.memberId;
62 }
63
64 /**
65 * Returns the primary key of the rowing session a participant has joined.
66 */
67 public Integer getRowingId() {
68 return this.rowingId;
69 }
70
71 /** Returns the primary key of a participant instance */
72 public Integer getParticipantId() {
73 return this.participantId;
74 }
75
76 /**
77 * Returns the requested seating position of a signed-up participant,
78 * or null if a participant is a substitute or an extra.
79 */
80 public SeatPreference getSeatPreference() {
81 return this.preference;
82 }
83
84 /**
85 * Returns the participant id of the signed-up, but absent, participant
86 * for whom this member is substituting, or null if this member is not a
87 * substitute.
88 */
89 public Integer getReplacesId() {
90 return this.replacesId;
91 }
92
93 /**
94 * Returns the initial seat assigned to a participant, or null if
95 * a participant hasn't been assigned an initial boating.</p><p>
96 *
97 * Note that seat id is not the same as seat number. A seat id is a primary
98 * key for a triplet value composed of a rowing_id (identifies a rowing
99 * session), a boat_id (identifies a particular sweep or scull), and
100 * a seat number (identifies a position within a sweep or scull).
101 */
102 public Integer getInitialSeatId() {
103 return this.initialSeatId;
104 }
105
106 /**
107 * Returns the final seat assigned to a participant, or null if
108 * a participant has not been assigned to a final boating.</p><p>
109 *
110 * See <tt>getInitialSeatId()</tt> for a note on the distinction between
111 * seat id and seat number.
112 */
113 public Integer getFinalSeatId() {
114 return this.finalSeatId;
115 }
116
117 /**
118 * Returns the attendance of a participant at a rowing session,
119 * or null if a participant has not been assigned an attendance.
120 */
121 public Attendance getAttendance() {
122 return this.attendance;
123 }
124
125 } // ParticipantSnapshot
126
127 /*
128 * $Log: ParticipantSnapshot.java,v $
129 * Revision 1.3 2003/02/26 03:38:45 rphall
130 * Added copyright and GPL license
131 *
132 * Revision 1.2 2002/02/18 18:04:43 rphall
133 * Ran dos2unix to remove ^M (carriage return) from end of lines
134 *
135 * Revision 1.1.1.1 2002/01/03 21:57:28 rphall
136 * Initial load, 5th try, Jan-03-2002 4:57 PM
137 *
138 * Revision 1.3 2001/12/13 21:22:54 rphall
139 * Fixed access control on getXxx()
140 *
141 * Revision 1.2 2001/12/13 01:30:21 rphall
142 * Enrollment business and web objects
143 *
144 * Revision 1.1 2001/12/12 04:49:43 rphall
145 * Compiles, but not yet tested
146 *
147 * Revision 1.1 2001/11/23 18:23:16 rphall
148 * Read-only view of participant data
149 *
150 * Revision 1.2 2001/11/18 18:15:01 rphall
151 * Fixed compilation problems
152 *
153 * Revision 1.1 2001/11/18 17:07:07 rphall
154 * Checkpt before major revision of rowing package
155 *
156 */
157