org.directwebremoting.datasync
Class SortCriteriaComparator<T>

java.lang.Object
  extended by org.directwebremoting.datasync.SortCriteriaComparator<T>
All Implemented Interfaces:
java.util.Comparator<T>

public class SortCriteriaComparator<T>
extends java.lang.Object
implements java.util.Comparator<T>

A Comparator that uses a list of SortCriterion to decide how to sort the beans. Values to sort by are extracted using an implementation of AttributeValueExtractor,.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
SortCriteriaComparator(java.util.List<SortCriterion> sort, ComparatorFactory<T> comparatorFactory)
          All SortCriteriaComparators need a set of things to sort on and a way to get the values to sort
 
Method Summary
 int compare(T object1, T object2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SortCriteriaComparator

public SortCriteriaComparator(java.util.List<SortCriterion> sort,
                              ComparatorFactory<T> comparatorFactory)
All SortCriteriaComparators need a set of things to sort on and a way to get the values to sort

Method Detail

compare

public int compare(T object1,
                   T object2)
Specified by:
compare in interface java.util.Comparator<T>

Copyright 2008