|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrsvp.controller.EventController
public class EventController
An EventController mediates interactions between the view layer and a particular Event.
Event
Constructor Summary | |
---|---|
EventController(EventInterface event)
Constructs an EventController to mediate access to a given Event. |
Method Summary | |
---|---|
void |
addResponse(EmailAddressInterface guest,
int status,
java.lang.String comment)
Adds a new response to this event, indicating whether or not a particular guest can attend. |
void |
delete(java.lang.String passcode)
Deletes the given Event by invoking its delete() method. |
SimpleDate |
getEventDate()
Returns the date of this event. |
java.lang.String |
getEventLocation()
Returns the location of this event. |
java.lang.String |
getEventName()
Returns the name of this event. |
EmailAddressInterface |
getEventOrganizer()
Returns the EmailAddress of this event's organizer or host. |
ResponseControllerInterface |
getResponseController(int id)
Returns a ResponseController to mediate access to the Response with the given ID. |
void |
setEventDate(SimpleDate date,
java.lang.String passcode)
Updates this event by changing its date. |
void |
setEventLocation(java.lang.String newLoc,
java.lang.String passcode)
Updates this event by changing its location. |
void |
setEventName(java.lang.String newName,
java.lang.String passcode)
Updates this event by changing its name. |
void |
setEventOrganizer(EmailAddressInterface email,
java.lang.String passcode)
Updates this event by changing its organizer. |
int |
totalResponsesForEvent()
Returns the total number of responses for this event, including "yes", "no", and "maybe" responses. |
int |
yesResponsesForEvent()
Returns the total number of "yes" responses for this event. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EventController(EventInterface event)
event
- Method Detail |
---|
public void delete(java.lang.String passcode)
EventControllerInterface
delete
in interface EventControllerInterface
passcode
- the passcode for this Eventpublic void setEventName(java.lang.String newName, java.lang.String passcode)
EventControllerInterface
setEventName
in interface EventControllerInterface
public void setEventOrganizer(EmailAddressInterface email, java.lang.String passcode)
EventControllerInterface
setEventOrganizer
in interface EventControllerInterface
email
- the email address of the new organizerpublic void setEventDate(SimpleDate date, java.lang.String passcode)
EventControllerInterface
setEventDate
in interface EventControllerInterface
date
- the new datepublic void setEventLocation(java.lang.String newLoc, java.lang.String passcode)
EventControllerInterface
setEventLocation
in interface EventControllerInterface
newLoc
- the new Location of this eventpublic java.lang.String getEventName()
EventControllerInterface
getEventName
in interface EventControllerInterface
public EmailAddressInterface getEventOrganizer()
EventControllerInterface
getEventOrganizer
in interface EventControllerInterface
public SimpleDate getEventDate()
EventControllerInterface
getEventDate
in interface EventControllerInterface
public java.lang.String getEventLocation()
EventControllerInterface
getEventLocation
in interface EventControllerInterface
public int totalResponsesForEvent()
EventControllerInterface
totalResponsesForEvent
in interface EventControllerInterface
public int yesResponsesForEvent()
EventControllerInterface
yesResponsesForEvent
in interface EventControllerInterface
public void addResponse(EmailAddressInterface guest, int status, java.lang.String comment)
EventControllerInterface
Preconditions: see below.
addResponse
in interface EventControllerInterface
guest
- the email address of the responding guest. Must correspond to a valid email address -- if it does not, this method will throw a BogusParameterException.status
- the response status. Must be one of Response.YES, Response.NO, or Response.MAYBE -- if it is not, this method will throw a BogusParameterException.comment
- the text of any explanatory comment that this guest has included with her reply.public ResponseControllerInterface getResponseController(int id)
EventControllerInterface
Preconditions: id must be valid, as below.
getResponseController
in interface EventControllerInterface
id
- a valid response identifier -- that is, one that is between 0 (inclusive) and totalResponsesForEvent() (exclusive)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |