com.jalios.jcms.caddy
Class CaddyComparator<T extends Data>

java.lang.Object
  extended by com.jalios.jcms.caddy.CaddyComparator<T>
Type Parameters:
T - subclass of Data
All Implemented Interfaces:
Comparator<T>

public class CaddyComparator<T extends Data>
extends Object
implements Comparator<T>

Compares Data based on their presence in the Caddy.

Since:
jcms-5.7
Version:
$Revision: 31349 $
Author:
Olivier Jaquemet

Constructor Summary
CaddyComparator()
          Constructs a new CaddyComparator using BasicStorable.MdateComparator as default comparator.
CaddyComparator(Comparator<T> comparator)
          Contructs a new CaddyComparator using the specified comparator.
 
Method Summary
 int compare(T data1, T data2)
           
 
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

CaddyComparator

public CaddyComparator()
Constructs a new CaddyComparator using BasicStorable.MdateComparator as default comparator.


CaddyComparator

public CaddyComparator(Comparator<T> comparator)
Contructs a new CaddyComparator using the specified comparator.

Parameters:
comparator - the Comparator to use when Data are either both in caddy or else both not in caddy, also if object could not be compared (for example when no Caddy could be retrieved or if object are not instance of Data).
Throws:
IllegalArgumentException - when specified comparator is null.
Method Detail

compare

public int compare(T data1,
                   T data2)
Specified by:
compare in interface Comparator<T extends Data>


Copyright © 2001-2010 Jalios SA. All Rights Reserved.