org.apache.directory.shared.ldap.schema
Class NormalizingComparator

java.lang.Object
  extended byorg.apache.directory.shared.ldap.schema.NormalizingComparator
All Implemented Interfaces:
java.util.Comparator

public class NormalizingComparator
extends java.lang.Object
implements java.util.Comparator

A comparator which normalizes a value first before using a subordinate comparator to compare them.

Version:
$Rev: 379008 $
Author:
Apache Directory Project

Constructor Summary
NormalizingComparator(Normalizer normalizer, java.util.Comparator comparator)
          A comparator which normalizes a value first before comparing them.
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          If any normalization attempt fails we compare using the unnormalized object.
 
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

NormalizingComparator

public NormalizingComparator(Normalizer normalizer,
                             java.util.Comparator comparator)
A comparator which normalizes a value first before comparing them.

Parameters:
normalizer - the Normalizer to normalize values with before comparing
comparator - the underlying comparator to use for comparisons
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
If any normalization attempt fails we compare using the unnormalized object.

Specified by:
compare in interface java.util.Comparator
See Also:
Comparator.compare(Object, Object)


Copyright © 2003-2006 . All Rights Reserved.