com.example.model
Class Sched

java.lang.Object
  extended by com.example.model.Sched

public class Sched
extends java.lang.Object

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 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
 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
 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

availableString

public java.lang.String[] availableString
Constructor Detail

Sched

public Sched()
Constructor, initializes some variables

Method Detail

putSched

public void putSched(int user,
                     int day,
                     java.lang.String sched)
Puts each schedule into the scheds array

Parameters:
user - is an int to tell which user is being added to
day - is an int to tell which day is being added to
sched - is an unformatted String with times that are unavailable

putRestrictions

public void putRestrictions(java.lang.String r)
Factors in overall scheduling restrictions

Parameters:
r - is an unformatted String with the range the output shoudl be in

displaySchedules

public 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

Parameters:
flag - is an int which tells what Schedule to output

getFreeTimes

public java.lang.String[] getFreeTimes()
Compares and combines the different schedules and returns the result, taking time restrictions into consideration


parseScheds

public 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


combineScheds

public 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


invertSched

public void invertSched()
Invert the "super-schedule" to produce a schedule listing all of the available free times


convertToString

public void convertToString()
Converts the "super-schedule" object to a single String (availableString) in standard-time human-readable format