|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.example.model.Sched
public class Sched
Schedule class including the functions to parse, combine, invert, and change to a string.
Field Summary | |
---|---|
java.lang.String[] |
availableString
|
Constructor Summary | |
---|---|
Sched()
Constructor, initializes some variables |
Method Summary | |
---|---|
void |
addSchedule(java.lang.String username,
java.lang.String monday,
java.lang.String tuesday,
java.lang.String wednesday,
java.lang.String thursday,
java.lang.String friday)
Takes a username and schedules for Monday through Friday and enters them into the database. |
void |
close()
|
void |
combineScheds()
Combines independent schedules (including the "restriction" schedule) into one "super-schedule" with all of the times factored in and no over-lapping time slots |
void |
convertToString()
Converts the "super-schedule" object to a single String (availableString) in standard-time human-readable format |
boolean |
createAccount(java.lang.String username,
java.lang.String password,
java.lang.String email)
Adds a user to the database. |
void |
displaySchedules(int flag)
Prints out all inputted schedules for debugging purposes flag = 0 for String output, flag = 1 for Vector output flag = 2 for superSched output, flag = 3 for inverted schedule output, flag = 4 for final string output |
java.lang.String[] |
getFreeTimes()
Compares and combines the different schedules and returns the result, taking time restrictions into consideration |
void |
invertSched()
Invert the "super-schedule" to produce a schedule listing all of the available free times |
boolean |
login(java.lang.String username,
java.lang.String password)
Takes a username and password and returns true if there is anentry in the database with a matching username and password, and false if there isn't. |
java.lang.String[] |
lookupSchedule(java.lang.String username)
Takes a username and returns an array of Strings containing the user's schedules for Monday through Friday. |
void |
parseScheds()
Parses a schedule into a form that can be used for easy comparisons (integers in military times within schedule objects) and also ensures that the format entered is valid |
void |
putRestrictions(java.lang.String r)
Factors in overall scheduling restrictions |
void |
putSched(int user,
int day,
java.lang.String sched)
Puts each schedule into the scheds array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.lang.String[] availableString
Constructor Detail |
---|
public Sched()
Method Detail |
---|
public void putSched(int user, int day, java.lang.String sched)
user
- is an int to tell which user is being added today
- is an int to tell which day is being added tosched
- is an unformatted String with times that are unavailablepublic void putRestrictions(java.lang.String r)
r
- is an unformatted String with the range the output shoudl be inpublic void displaySchedules(int flag)
flag
- is an int which tells what Schedule to outputpublic java.lang.String[] getFreeTimes()
public void parseScheds()
public void combineScheds()
public void invertSched()
public void convertToString()
public boolean login(java.lang.String username, java.lang.String password) throws java.lang.Exception
username
- is a string that contains the username to loginpassword
- is a string that contains the password to login
java.lang.Exception
public boolean createAccount(java.lang.String username, java.lang.String password, java.lang.String email) throws java.lang.Exception
username
- is a string that contains a usernamepassword
- is a string that contains a passwordemail
- is a string which contains an email address
java.lang.Exception
public java.lang.String[] lookupSchedule(java.lang.String username) throws java.lang.Exception
username
- is a username which is being looked up
java.lang.Exception
public void addSchedule(java.lang.String username, java.lang.String monday, java.lang.String tuesday, java.lang.String wednesday, java.lang.String thursday, java.lang.String friday) throws java.lang.Exception
username
- is a string which has the username which is being added tomonday
- is a string of unavailable times for mondaytuesday
- is a string of unavailable times for tuesdaywednesday
- is a string of unavailable times for wednesdaythursday
- is a string of unavailable times for thursdayfriday
- is a string of unavailable times for friday
java.lang.Exception
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |