org.sakaiproject.tool.assessment.util
Class BeanSortComparator

java.lang.Object
  extended byorg.sakaiproject.tool.assessment.util.BeanSortComparator
All Implemented Interfaces:
Comparator
Direct Known Subclasses:
BeanDateComparator, BeanFloatComparator, BeanIntegerComparator

public class BeanSortComparator
extends Object
implements Comparator

DOCUMENTATION PENDING

Version:
$Id: BeanSortComparator.java 2574 2005-10-13 19:56:46Z esmiley@stanford.edu $
Author:
$author$

Constructor Summary
protected BeanSortComparator()
          Creates a new BeanSortComparator object.
  BeanSortComparator(String propertyName)
          The only public constructor.
 
Method Summary
 int compare(Object o1, Object o2)
          standard compare method
protected  Map describeBean(Object o)
          protected utility method to wrap BeanUtils
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

BeanSortComparator

public BeanSortComparator(String propertyName)
The only public constructor. Requires a valid property name for a a Java Bean as a sole parameter.

Parameters:
propertyName - the property name for Java Bean to sort by

BeanSortComparator

protected BeanSortComparator()
Creates a new BeanSortComparator object.

Method Detail

compare

public int compare(Object o1,
                   Object o2)
standard compare method

Specified by:
compare in interface Comparator
Parameters:
o1 - object
o2 - object
Returns:
lt, eq, gt zero depending on whether o1 lt, eq, gt o2

describeBean

protected Map describeBean(Object o)
protected utility method to wrap BeanUtils

Parameters:
o - DOCUMENTATION PENDING
Returns:
DOCUMENTATION PENDING
Throws:
UnsupportedOperationException - DOCUMENTATION PENDING