* @return a negative integer, zero, or a positive integer
*/
private int compareRdnValues( IEntry entry1, IEntry entry2 )
{
RDN rdn1 = entry1.getRdn();
RDN rdn2 = entry2.getRdn();
if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
&& ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
{
return equal();
}
else if ( ( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
&& !( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
{
return greaterThan();
}
else if ( !( rdn1 == null || rdn1.getValue() == null || "".equals( rdn1.getValue() ) )
&& ( rdn2 == null || rdn2.getValue() == null || "".equals( rdn2.getValue() ) ) )
{
return lessThan();
}
else if ( rdn1.getValue().matches( "\\d*" ) && !rdn2.getValue().matches( "\\d*" ) )
{
// return lessThan();
return compare( rdn1.getValue(), rdn2.getValue() );
}
else if ( !rdn1.getValue().matches( "\\d*" ) && rdn2.getValue().matches( "\\d*" ) )
{
// return greaterThan();
return compare( rdn1.getValue(), rdn2.getValue() );
}
else if ( rdn1.getValue().matches( "\\d*" ) && rdn2.getValue().matches( "\\d*" ) )
{
BigInteger bi1 = new BigInteger( rdn1.getValue() );
BigInteger bi2 = new BigInteger( rdn2.getValue() );
return compare( bi1, bi2 );
// return Integer.parseInt(rdn1.getValue()) -
// Integer.parseInt(rdn2.getValue());
}
else
{
return compare( rdn1.getValue(), rdn2.getValue() );
}
}