org.sakaiproject.tool.gradebook
Class GradableObject

java.lang.Object
  extended by org.sakaiproject.tool.gradebook.GradableObject
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Assignment, CourseGrade

public abstract class GradableObject
extends Object
implements Serializable

A GradableObject is a component of a Gradebook for which students can be assigned a GradeRecord.

Author:
Josh Holtzman
See Also:
Serialized Form

Field Summary
static Comparator<Assignment> categoryComparator
           
static Comparator<Assignment> dateComparator
           
static Comparator<GradableObject> defaultComparator
           
protected  Gradebook gradebook
           
protected  Long id
           
static Comparator<GradableObject> idComparator
           
protected static org.apache.commons.logging.Log log
           
protected  Double mean
           
static Comparator<GradableObject> meanComparator
           
protected  String name
           
static Comparator<GradableObject> nameComparator
           
protected  boolean removed
           
static Comparator<GradableObject> sortingComparator
           
protected  Integer sortOrder
           
protected  int version
           
 
Constructor Summary
GradableObject()
           
 
Method Summary
 void assignSorting(int sortTotalItems, int sortTruePosition)
           
 boolean equals(Object other)
           
 Double getFormattedMean()
           
 Gradebook getGradebook()
           
 Long getId()
           
abstract  boolean getIsCategory()
           
 Double getMean()
           
 String getName()
          This should really only be a field in Assignment objects, since the string describing CourseGrade needs to allow for localization.
 Integer getSortOrder()
           
 int getSortPosition()
           
 int getVersion()
           
 int hashCode()
           
abstract  boolean isAssignment()
           
abstract  boolean isCourseGrade()
           
 boolean isFirst()
           
 boolean isLast()
           
 boolean isRemoved()
           
 void setGradebook(Gradebook gradebook)
           
 void setId(Long id)
           
 void setMean(Double mean)
           
 void setName(String name)
           
 void setRemoved(boolean removed)
           
 void setSortOrder(Integer sortOrder)
           
 void setVersion(int version)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

id

protected Long id

version

protected int version

gradebook

protected Gradebook gradebook

name

protected String name

sortOrder

protected Integer sortOrder

mean

protected Double mean

removed

protected boolean removed

defaultComparator

public static Comparator<GradableObject> defaultComparator

sortingComparator

public static Comparator<GradableObject> sortingComparator

dateComparator

public static Comparator<Assignment> dateComparator

meanComparator

public static Comparator<GradableObject> meanComparator

nameComparator

public static Comparator<GradableObject> nameComparator

idComparator

public static Comparator<GradableObject> idComparator

categoryComparator

public static Comparator<Assignment> categoryComparator
Constructor Detail

GradableObject

public GradableObject()
Method Detail

isCourseGrade

public abstract boolean isCourseGrade()
Returns:
Whether this gradable object is a course grade

isAssignment

public abstract boolean isAssignment()
Returns:
Whether this gradable object is an assignment

getIsCategory

public abstract boolean getIsCategory()
Returns:
Whether this gradable object is a category

getId

public Long getId()
Returns:
Returns the id.

setId

public void setId(Long id)
Parameters:
id - The id to set.

getGradebook

public Gradebook getGradebook()
Returns:
Returns the gradebook.

setGradebook

public void setGradebook(Gradebook gradebook)
Parameters:
gradebook - The gradebook to set.

getMean

public Double getMean()
Returns:
Returns the mean.

getFormattedMean

public Double getFormattedMean()
Returns:
Returns the mean while protecting against displaying NaN.

setMean

public void setMean(Double mean)
Parameters:
mean - The mean to set.

getName

public String getName()
This should really only be a field in Assignment objects, since the string describing CourseGrade needs to allow for localization. Unfortunately, such we keep CourseGrade and Assignment objects in the same table, and since we want Assignment names to be enforced as non-nullable, we're stuck with a bogus CourseGrade "name" field for now. The UI will have to be smart enough to disregard it.

Returns:
Returns the name.

setName

public void setName(String name)
Parameters:
name - The name to set.

getVersion

public int getVersion()
Returns:
Returns the version.

setVersion

public void setVersion(int version)
Parameters:
version - The version to set.

isRemoved

public boolean isRemoved()
Returns:
Returns the removed.

setRemoved

public void setRemoved(boolean removed)
Parameters:
removed - The removed to set.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

assignSorting

public void assignSorting(int sortTotalItems,
                          int sortTruePosition)

isFirst

public boolean isFirst()

isLast

public boolean isLast()

getSortPosition

public int getSortPosition()

getSortOrder

public Integer getSortOrder()

setSortOrder

public void setSortOrder(Integer sortOrder)


Copyright © 2011 Sakai Project. All Rights Reserved.