org.sakaiproject.component.section.sakai21
Class CourseSectionImpl

java.lang.Object
  extended byorg.sakaiproject.component.section.sakai21.CourseSectionImpl
All Implemented Interfaces:
Comparable, CourseSection, LearningContext, Serializable

public class CourseSectionImpl
extends Object
implements CourseSection, Comparable, Serializable

See Also:
Serialized Form

Field Summary
protected  String category
           
static String CATEGORY
           
protected  Course course
           
protected  String description
           
static String END_TIME
           
static String FRIDAY
           
protected  String id
           
protected  String location
           
static String LOCATION
           
static String MAX_ENROLLMENTS
           
protected  Integer maxEnrollments
           
static String MONDAY
           
static String SATURDAY
           
static String START_TIME
           
static String SUNDAY
           
static String THURSDAY
           
protected  String title
           
static String TUESDAY
           
protected  String uuid
           
static String WEDNESDAY
           
 
Constructor Summary
CourseSectionImpl(Group group)
           
 
Method Summary
 int compareTo(Object o)
          Compares CourseSectionImpls based on their category ID and title.
static Time convertStringToTime(String str)
           
static String convertTimeToString(Time time)
           
 void decorateSection(Group group)
          Decorates the framework's section (group) with metadata from this CourseSection.
 boolean equals(Object o)
           
 String getCategory()
          Gets the category ID of this CourseSection.
 Course getCourse()
          Gets the Course that this CourseSection belongs to
 String getDescription()
           
 Time getEndTime()
          Gets the time of day that this CourseSection's meeting(s) end.
 Group getGroup()
          Access the group object being decorated.
 String getId()
           
 String getLocation()
          Gets the location where this CourseSection meets.
 Integer getMaxEnrollments()
          Gets the maximum number of enrollments allowed in this CourseSection.
 Time getStartTime()
          Gets the time of day that this CourseSection's meeting(s) start.
 String getTitle()
           
 String getUuid()
           
 int hashCode()
           
 boolean isFriday()
          Whether the CourseSection meets on Fridays.
 boolean isMonday()
          Whether the CourseSection meets on Mondays.
 boolean isSaturday()
          Whether the CourseSection meets on Saturdays.
 boolean isSunday()
          Whether the CourseSection meets on Sundays.
 boolean isThursday()
          Whether the CourseSection meets on Thursdays.
 boolean isTuesday()
          Whether the CourseSection meets on Tuesdays.
 boolean isWednesday()
          Whether the CourseSection meets on Wednesdays.
 void setAddFields(String category, String title, String location, Integer maxEnrollments, Time startTime, Time endTime, boolean monday, boolean tuesday, boolean wednesday, boolean thursday, boolean friday, boolean saturday, boolean sunday)
          Sets the fields for an add section operation so we can easily call decorateSection.
 void setCategory(String category)
           
 void setCourse(Course course)
           
 void setDescription(String description)
           
 void setEndTime(Time endTime)
           
 void setFriday(boolean friday)
           
 void setId(String id)
           
 void setLocation(String location)
           
 void setMaxEnrollments(Integer maxEnrollments)
           
 void setMonday(boolean monday)
           
 void setSaturday(boolean saturday)
           
 void setStartTime(Time startTime)
           
 void setSunday(boolean sunday)
           
 void setThursday(boolean thursday)
           
 void setTitle(String title)
           
 void setTuesday(boolean tuesday)
           
 void setUpdateFields(String title, String location, Integer maxEnrollments, Time startTime, Time endTime, boolean monday, boolean tuesday, boolean wednesday, boolean thursday, boolean friday, boolean saturday, boolean sunday)
          Sets the fields for an update so we can easily call decorateSection.
 void setUuid(String uuid)
           
 void setWednesday(boolean wednesday)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CATEGORY

public static final String CATEGORY
See Also:
Constant Field Values

END_TIME

public static final String END_TIME
See Also:
Constant Field Values

START_TIME

public static final String START_TIME
See Also:
Constant Field Values

LOCATION

public static final String LOCATION
See Also:
Constant Field Values

MAX_ENROLLMENTS

public static final String MAX_ENROLLMENTS
See Also:
Constant Field Values

MONDAY

public static final String MONDAY
See Also:
Constant Field Values

TUESDAY

public static final String TUESDAY
See Also:
Constant Field Values

WEDNESDAY

public static final String WEDNESDAY
See Also:
Constant Field Values

THURSDAY

public static final String THURSDAY
See Also:
Constant Field Values

FRIDAY

public static final String FRIDAY
See Also:
Constant Field Values

SATURDAY

public static final String SATURDAY
See Also:
Constant Field Values

SUNDAY

public static final String SUNDAY
See Also:
Constant Field Values

description

protected String description

uuid

protected String uuid

course

protected Course course

category

protected String category

location

protected String location

maxEnrollments

protected Integer maxEnrollments

id

protected String id

title

protected String title
Constructor Detail

CourseSectionImpl

public CourseSectionImpl(Group group)
Method Detail

convertTimeToString

public static final String convertTimeToString(Time time)

convertStringToTime

public static final Time convertStringToTime(String str)

decorateSection

public void decorateSection(Group group)
Decorates the framework's section (group) with metadata from this CourseSection.

Parameters:
group - The framework group

setUpdateFields

public void setUpdateFields(String title,
                            String location,
                            Integer maxEnrollments,
                            Time startTime,
                            Time endTime,
                            boolean monday,
                            boolean tuesday,
                            boolean wednesday,
                            boolean thursday,
                            boolean friday,
                            boolean saturday,
                            boolean sunday)
Sets the fields for an update so we can easily call decorateSection.

Parameters:
title -
location -
maxEnrollments -
startTime -
endTime -
monday -
tuesday -
wednesday -
thursday -
friday -
saturday -
sunday -

setAddFields

public void setAddFields(String category,
                         String title,
                         String location,
                         Integer maxEnrollments,
                         Time startTime,
                         Time endTime,
                         boolean monday,
                         boolean tuesday,
                         boolean wednesday,
                         boolean thursday,
                         boolean friday,
                         boolean saturday,
                         boolean sunday)
Sets the fields for an add section operation so we can easily call decorateSection.

Parameters:
category -
title -
location -
maxEnrollments -
startTime -
endTime -
monday -
tuesday -
wednesday -
thursday -
friday -
saturday -
sunday -

getCategory

public String getCategory()
Description copied from interface: CourseSection
Gets the category ID of this CourseSection. Students may be enrolled in only one section of a given category per Course.

Specified by:
getCategory in interface CourseSection
Returns:

setCategory

public void setCategory(String category)

getCourse

public Course getCourse()
Description copied from interface: CourseSection
Gets the Course that this CourseSection belongs to

Specified by:
getCourse in interface CourseSection
Returns:

setCourse

public void setCourse(Course course)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getEndTime

public Time getEndTime()
Description copied from interface: CourseSection
Gets the time of day that this CourseSection's meeting(s) end.

Specified by:
getEndTime in interface CourseSection
Returns:

setEndTime

public void setEndTime(Time endTime)

isFriday

public boolean isFriday()
Description copied from interface: CourseSection
Whether the CourseSection meets on Fridays.

Specified by:
isFriday in interface CourseSection
Returns:

setFriday

public void setFriday(boolean friday)

getId

public String getId()

setId

public void setId(String id)

getLocation

public String getLocation()
Description copied from interface: CourseSection
Gets the location where this CourseSection meets.

Specified by:
getLocation in interface CourseSection
Returns:

setLocation

public void setLocation(String location)

getMaxEnrollments

public Integer getMaxEnrollments()
Description copied from interface: CourseSection
Gets the maximum number of enrollments allowed in this CourseSection. Instructors and TAs may assign more than the maximum number of enrollments, but students may not self enroll in a section at or above the maximum number of enrollments.

Specified by:
getMaxEnrollments in interface CourseSection
Returns:

setMaxEnrollments

public void setMaxEnrollments(Integer maxEnrollments)

isMonday

public boolean isMonday()
Description copied from interface: CourseSection
Whether the CourseSection meets on Mondays.

Specified by:
isMonday in interface CourseSection
Returns:

setMonday

public void setMonday(boolean monday)

isSaturday

public boolean isSaturday()
Description copied from interface: CourseSection
Whether the CourseSection meets on Saturdays.

Specified by:
isSaturday in interface CourseSection
Returns:

setSaturday

public void setSaturday(boolean saturday)

getStartTime

public Time getStartTime()
Description copied from interface: CourseSection
Gets the time of day that this CourseSection's meeting(s) start.

Specified by:
getStartTime in interface CourseSection
Returns:

setStartTime

public void setStartTime(Time startTime)

isSunday

public boolean isSunday()
Description copied from interface: CourseSection
Whether the CourseSection meets on Sundays.

Specified by:
isSunday in interface CourseSection
Returns:

setSunday

public void setSunday(boolean sunday)

isThursday

public boolean isThursday()
Description copied from interface: CourseSection
Whether the CourseSection meets on Thursdays.

Specified by:
isThursday in interface CourseSection
Returns:

setThursday

public void setThursday(boolean thursday)

getTitle

public String getTitle()
Specified by:
getTitle in interface LearningContext

setTitle

public void setTitle(String title)

isTuesday

public boolean isTuesday()
Description copied from interface: CourseSection
Whether the CourseSection meets on Tuesdays.

Specified by:
isTuesday in interface CourseSection
Returns:

setTuesday

public void setTuesday(boolean tuesday)

getUuid

public String getUuid()
Specified by:
getUuid in interface LearningContext

setUuid

public void setUuid(String uuid)

isWednesday

public boolean isWednesday()
Description copied from interface: CourseSection
Whether the CourseSection meets on Wednesdays.

Specified by:
isWednesday in interface CourseSection
Returns:

setWednesday

public void setWednesday(boolean wednesday)

equals

public boolean equals(Object o)

hashCode

public int hashCode()

compareTo

public int compareTo(Object o)
Compares CourseSectionImpls based on their category ID and title. Sections without a category are sorted last.

Specified by:
compareTo in interface Comparable

getGroup

public Group getGroup()
Access the group object being decorated. This field is transient, so this is likely to return null. This method should not be added to the CourseSection interface, since it is implementation dependent.

Returns:
The transient Group object being modeled.