org.sakaiproject.component.common.edu.coursemanagement
Class CanonicalCourseImpl

java.lang.Object
  extended byorg.sakaiproject.component.common.edu.coursemanagement.CanonicalCourseImpl
All Implemented Interfaces:
CanonicalCourse, Persistable, Serializable

public class CanonicalCourseImpl
extends Object
implements CanonicalCourse, Serializable

See Also:
Serialized Form

Constructor Summary
CanonicalCourseImpl()
           
CanonicalCourseImpl(String title, String description, String courseNumber, String uuid, CanonicalCourseStatusType status)
           
 
Method Summary
 void addCourseOffering(CourseOfferingImpl offering)
           
 void addEquivalent(String equivalent)
          Add the canonical course given by its uuid to the list of equivalent courses.
 void addPrerequisite(String prerequisite)
          Add a prerequisite string to the list of prerequisites.
 void addTopic(String topic)
          Add a topic string to the list of course topics.
 boolean equals(Object rhs)
          Implementation of the equals comparison on the basis of equality of the primary key values.
 Long getCanonicalCourseId()
           
 CanonicalCourseStatusType getCanonicalCourseStatus()
          Get the course type of this canonical course.
 String getCourseNumber()
          Get the course number.
 String getCreatedBy()
          The Agent that created this persistent object.
 Date getCreatedDate()
          The time and date this persistent object was created.
 String getDefaultCredits()
          Get the default credits for this course.
 String getDescription()
          Get the description of this canonical course.
 Set getEquivalents()
          Get a list of equivalent canonical courses uuids.
 String getEquivalentString()
          Return the value of the TOPICS column.
 String getLastModifiedBy()
          The last Agent that modified the persistent state of this object.
 Date getLastModifiedDate()
          The last time this object's persistent state was modified.
 Set getOfferings()
          Get a set of course offering uuids derived from this canonical course.
 String getParentId()
          Get the uuid of the parent of this canonical course.
 Set getPrerequisites()
          Get the set of prerequisites.
 String getPrerequisiteString()
          Return the value of the Equivalent column.
 String getTitle()
          Get the title of a canonical course as it might appear in a course catalog.
 List getTopics()
          Get a list of topics associated with this course.
 String getTopicsString()
          Return the value of the TOPICS column.
 String getUuid()
          All persistent objects must have a UUID.
 int hashCode()
          Implementation of the hashCode method conforming to the Bloch pattern with the exception of array properties (these are very unlikely primary key types).
 void removeCourseOffering(CourseOfferingImpl offering)
           
 void removeEquivalent(String equivalent)
          Remove the canonical course given by its uuid to the list of equivalent courses.
 void removeOffering(String offeringUuid)
          Remove a course offering from the list in this canonical course.
 void removePrerequisite(String prerequisite)
          Remove a prerequisite string to the list of prerequisites.
 void removeTopic(String topic)
          Remove a topic string from the list of course topics.
 void setCanonicalCourseId(Long canonicalCourseId)
           
 void setCanonicalCourseStatus(CanonicalCourseStatusType status)
          Set the course type of this canonical course.
 void setCourseNumber(String courseNumber)
          Set the course number.
 void setCreatedBy(String createdBy)
           
 void setCreatedDate(Date createdDate)
           
 void setDefaultCredits(String defaultCredits)
          Set the defalt credits.
 void setDescription(String description)
          Set the description of this canonical course.
 void setEquivalentString(String equivalentString)
          Set the value of the Equivalent column.
 void setLastModifiedBy(String lastModifiedBy)
           
 void setLastModifiedDate(Date lastModifiedDate)
           
 void setOfferings(Set offerings)
           
 void setParentId(String parentUuid)
          Set the uuid parent of this course.
 void setPrerequisiteString(String prerequisiteString)
          Set the value of the Equivalent column.
 void setTitle(String title)
          Set the title of a canonical course as it might appear in a course catalog.
 void setTopicsString(String topicsString)
          Set the value of the TOPICS column.
 void setUuid(String uuid)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CanonicalCourseImpl

public CanonicalCourseImpl()

CanonicalCourseImpl

public CanonicalCourseImpl(String title,
                           String description,
                           String courseNumber,
                           String uuid,
                           CanonicalCourseStatusType status)
Method Detail

getCanonicalCourseId

public Long getCanonicalCourseId()

setCanonicalCourseId

public void setCanonicalCourseId(Long canonicalCourseId)

getTitle

public String getTitle()
Description copied from interface: CanonicalCourse
Get the title of a canonical course as it might appear in a course catalog.

Specified by:
getTitle in interface CanonicalCourse
Returns:
the tile of the canonical course.

setTitle

public void setTitle(String title)
Description copied from interface: CanonicalCourse
Set the title of a canonical course as it might appear in a course catalog.

Specified by:
setTitle in interface CanonicalCourse
Parameters:
title -

getDescription

public String getDescription()
Description copied from interface: CanonicalCourse
Get the description of this canonical course.

Specified by:
getDescription in interface CanonicalCourse
Returns:
the desription of the canonical course.

setDescription

public void setDescription(String description)
Description copied from interface: CanonicalCourse
Set the description of this canonical course.

Specified by:
setDescription in interface CanonicalCourse
Parameters:
description -

getCourseNumber

public String getCourseNumber()
Description copied from interface: CanonicalCourse
Get the course number. There are no restrictions on how this number is formatted.

Specified by:
getCourseNumber in interface CanonicalCourse
Returns:
Course number

setCourseNumber

public void setCourseNumber(String courseNumber)
Description copied from interface: CanonicalCourse
Set the course number. There are no restirctions on how this number is foramtted.

Specified by:
setCourseNumber in interface CanonicalCourse
Parameters:
courseNumber -

getDefaultCredits

public String getDefaultCredits()
Description copied from interface: CanonicalCourse
Get the default credits for this course. While there are no requirements on what this field contains, a numerical quantity is likely expected.

Specified by:
getDefaultCredits in interface CanonicalCourse
Returns:
the default credits.

setDefaultCredits

public void setDefaultCredits(String defaultCredits)
Description copied from interface: CanonicalCourse
Set the defalt credits.

Specified by:
setDefaultCredits in interface CanonicalCourse
Parameters:
defaultCredits -

getTopicsString

public String getTopicsString()
Return the value of the TOPICS column.

Returns:
String

setTopicsString

public void setTopicsString(String topicsString)
Set the value of the TOPICS column.

Parameters:
topicsString -

getTopics

public List getTopics()
Description copied from interface: CanonicalCourse
Get a list of topics associated with this course. Each topic is a text string. Order of topic strings is retained.

Specified by:
getTopics in interface CanonicalCourse
Returns:
List of topic strings.

addTopic

public void addTopic(String topic)
Description copied from interface: CanonicalCourse
Add a topic string to the list of course topics.

Specified by:
addTopic in interface CanonicalCourse
Parameters:
topic -

removeTopic

public void removeTopic(String topic)
Description copied from interface: CanonicalCourse
Remove a topic string from the list of course topics. String must be identical to the one being removed.

Specified by:
removeTopic in interface CanonicalCourse
Parameters:
topic -

getPrerequisiteString

public String getPrerequisiteString()
Return the value of the Equivalent column.

Returns:
String

setPrerequisiteString

public void setPrerequisiteString(String prerequisiteString)
Set the value of the Equivalent column.

Parameters:
prerequisiteString -

getPrerequisites

public Set getPrerequisites()
Description copied from interface: CanonicalCourse
Get the set of prerequisites.

Specified by:
getPrerequisites in interface CanonicalCourse
Returns:
Set of prerequiste strings.

addPrerequisite

public void addPrerequisite(String prerequisite)
Description copied from interface: CanonicalCourse
Add a prerequisite string to the list of prerequisites.

Specified by:
addPrerequisite in interface CanonicalCourse
Parameters:
prerequisite -

removePrerequisite

public void removePrerequisite(String prerequisite)
Description copied from interface: CanonicalCourse
Remove a prerequisite string to the list of prerequisites. The string must be identical to the one being removed.

Specified by:
removePrerequisite in interface CanonicalCourse
Parameters:
prerequisite -

getCanonicalCourseStatus

public CanonicalCourseStatusType getCanonicalCourseStatus()
Description copied from interface: CanonicalCourse
Get the course type of this canonical course. Typically, this type will indicate if ths canonical course is available, discontinued, etc.

Specified by:
getCanonicalCourseStatus in interface CanonicalCourse
Returns:
status

setCanonicalCourseStatus

public void setCanonicalCourseStatus(CanonicalCourseStatusType status)
Description copied from interface: CanonicalCourse
Set the course type of this canonical course.

Specified by:
setCanonicalCourseStatus in interface CanonicalCourse
Parameters:
status -

getEquivalentString

public String getEquivalentString()
Return the value of the TOPICS column.

Returns:
String

setEquivalentString

public void setEquivalentString(String equivalentString)
Set the value of the Equivalent column.

Parameters:
equivalentString -

getEquivalents

public Set getEquivalents()
Description copied from interface: CanonicalCourse
Get a list of equivalent canonical courses uuids. This is one way to represent cross listing in a set of courses.

Specified by:
getEquivalents in interface CanonicalCourse
Returns:
List of canonical course uuids.

addEquivalent

public void addEquivalent(String equivalent)
Description copied from interface: CanonicalCourse
Add the canonical course given by its uuid to the list of equivalent courses.

Specified by:
addEquivalent in interface CanonicalCourse
Parameters:
equivalent -

removeEquivalent

public void removeEquivalent(String equivalent)
Description copied from interface: CanonicalCourse
Remove the canonical course given by its uuid to the list of equivalent courses.

Specified by:
removeEquivalent in interface CanonicalCourse
Parameters:
equivalent -

getOfferings

public Set getOfferings()
Description copied from interface: CanonicalCourse
Get a set of course offering uuids derived from this canonical course.

Specified by:
getOfferings in interface CanonicalCourse
Returns:
Set of course offering uuids.

setOfferings

public void setOfferings(Set offerings)

addCourseOffering

public void addCourseOffering(CourseOfferingImpl offering)

removeCourseOffering

public void removeCourseOffering(CourseOfferingImpl offering)

removeOffering

public void removeOffering(String offeringUuid)
Description copied from interface: CanonicalCourse
Remove a course offering from the list in this canonical course. Uuid must be identical to the one to be removed.

Specified by:
removeOffering in interface CanonicalCourse
Parameters:
offeringUuid -

getParentId

public String getParentId()
Description copied from interface: CanonicalCourse
Get the uuid of the parent of this canonical course. Null is returned if there is no partent of this course.

Specified by:
getParentId in interface CanonicalCourse
Returns:
Uuid of parent.

setParentId

public void setParentId(String parentUuid)
Description copied from interface: CanonicalCourse
Set the uuid parent of this course.

Specified by:
setParentId in interface CanonicalCourse
Parameters:
parentUuid -

getUuid

public String getUuid()
Description copied from interface: Persistable
All persistent objects must have a UUID.

Specified by:
getUuid in interface Persistable
Returns:
Returns the UUID for given object.

setUuid

public void setUuid(String uuid)

getCreatedBy

public String getCreatedBy()
Description copied from interface: Persistable
The Agent that created this persistent object.

Specified by:
getCreatedBy in interface Persistable
Returns:
UUID of the Agent that created this persistent object.

setCreatedBy

public void setCreatedBy(String createdBy)

getCreatedDate

public Date getCreatedDate()
Description copied from interface: Persistable
The time and date this persistent object was created.

Specified by:
getCreatedDate in interface Persistable
Returns:

setCreatedDate

public void setCreatedDate(Date createdDate)

getLastModifiedBy

public String getLastModifiedBy()
Description copied from interface: Persistable
The last Agent that modified the persistent state of this object.

Specified by:
getLastModifiedBy in interface Persistable
Returns:
UUID of Agent that made last modification.

setLastModifiedBy

public void setLastModifiedBy(String lastModifiedBy)

getLastModifiedDate

public Date getLastModifiedDate()
Description copied from interface: Persistable
The last time this object's persistent state was modified.

Specified by:
getLastModifiedDate in interface Persistable
Returns:

setLastModifiedDate

public void setLastModifiedDate(Date lastModifiedDate)

equals

public boolean equals(Object rhs)
Implementation of the equals comparison on the basis of equality of the primary key values.

Parameters:
rhs -
Returns:
boolean

hashCode

public int hashCode()
Implementation of the hashCode method conforming to the Bloch pattern with the exception of array properties (these are very unlikely primary key types).

Returns:
int