All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sat.Validator

java.lang.Object
   |
   +----sat.Validator

public class Validator
extends Object
this class has functions which validate the data passed in as parameters. It also returns metadata about events/subevents - whether the event is team based or not, whether a user has registered for subevent or not, etc.

Author:
Satyen Kale

Constructor Index

 o Validator()
a constructor.

Method Index

 o firstTime(String)
returns true if the Event_Manager has logged in for the first time.
 o firstTime(String, String)
returns true if the SubEvent_Manager has logged in for the first time.
 o isModerated(String)
returns true if an event is moderated.
 o isModerated(String, String)
returns true if a subevent is moderated.
 o isRegisteredFor(String, String)
returns true if the userid is registered for the given event
 o isTeamBased(String)
returns true if a an event is team based.
 o isTeamMember(String)
checks if flo is already a team member
 o isValidEventID(String)
checks if a given event_id exists.
 o isValidSubEventID(String, String)
checks if a given subevent_id exists within a given event_id.
 o nextPID()
returns the next PID in the list

Constructors

 o Validator
 public Validator()
a constructor.

Methods

 o isValidEventID
 public boolean isValidEventID(String event_id)
checks if a given event_id exists.

Parameters:
event_id - the id to be checked
Returns:
true if event_id exists, false otherwise
 o isValidSubEventID
 public boolean isValidSubEventID(String event_id,
                                  String subevent_id)
checks if a given subevent_id exists within a given event_id.

Parameters:
event_id - the event under which the subevent_id should exist.
subevent_id - the id to be checked.
Returns:
true if subevent_id exists, false otherwise.
 o isTeamBased
 public boolean isTeamBased(String event_id) throws IllegalArgumentException
returns true if a an event is team based.

Parameters:
event_id - the id of the event
Returns:
true if event is team based, false if not.
Throws: IllegalArgumentException
if this method is called when this field has not been set yet.
 o isModerated
 public boolean isModerated(String event_id) throws IllegalArgumentException
returns true if an event is moderated.

Parameters:
event_id - the id of the event
Returns:
true if event is moderated, false if not.
Throws: IllegalArgumentException
if this method is called when this field has not been set yet.
 o isModerated
 public boolean isModerated(String event_id,
                            String subevent_id)
returns true if a subevent is moderated.

Parameters:
event_id - the id of the event
subevent_id - the id of the subevent
Returns:
true if event is moderated, false if not.
 o isRegisteredFor
 public boolean isRegisteredFor(String userid,
                                String event_id)
returns true if the userid is registered for the given event

Parameters:
userid - the user's login id
event_id - the given event
Returns:
true if the user is registered, false if not
 o firstTime
 public boolean firstTime(String event_id)
returns true if the Event_Manager has logged in for the first time.

Parameters:
event_id - the ID of the event
Returns:
true if the Event_Manager has logged in
for the first time, false if not.
 o firstTime
 public boolean firstTime(String event_id,
                          String subevent_id)
returns true if the SubEvent_Manager has logged in for the first time.

Parameters:
event_id - the ID of the event
subevent_id - the ID of the subevent
Returns:
true if the SubEvent_Manager has logged in
for the first time, false if not.
 o nextPID
 public int nextPID()
returns the next PID in the list

Returns:
the next PID
 o isTeamMember
 public boolean isTeamMember(String email)
checks if flo is already a team member

Parameters:
email - the email ID of the flo
Returns:
true if team member, false otherwise

All Packages  Class Hierarchy  This Package  Previous  Next  Index