directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <>
Subject DN compareTo()
Date Wed, 08 Jul 2015 08:47:20 GMT
Hi guys,

I'm not sure we have not already implemented a dn.compareTo() method
somewhere in a utility class...

Just in case, I'll add it to the API. I think the algorithm for such a
method would be :

- if both dn are equals, return 0
- if dn1.isDescendant( dn2 ) return 1
- if dn2.isDescendant( dn1 ) return -1
- otherwise, find the common parent
  - if found, compare the first RDN after the parent in both RDN and
return the result (Rdn has a compareTo method)
  - otherwise, compare the first RDN of both DN

sounds good ?

View raw message