public static int compare ( Object left , Object right ) throws PageException { // print.dumpStack(); if ( left instanceof String ) return compare ( ( String ) left , right ) ; else if ( left instanceof Number ) return compare ( ( ( Number ) left ) . doubleValue ( ) , right ) ; else if ( left instanceof Boolean ) return compare ( ( ( Boolean ) left ) . booleanValue ( ) , right ) ; else if ( left instanceof Date ) return compare ( ( Date ) left , right ) ; else if ( left instanceof Castable ) return compare ( ( ( Castable ) left ) , right ) ; else if ( left instanceof Locale ) return compare ( ( ( Locale ) left ) , right ) ; else if ( left == null ) return compare ( "" , right ) ; /* * /NICE disabled at the moment left Comparable else if(left instanceof Comparable) { return * ((Comparable)left).compareTo(right); } */ else if ( left instanceof Character ) return compare ( ( ( Character ) left ) . toString ( ) , right ) ; else if ( left instanceof Calendar ) return compare ( ( ( Calendar ) left ) . getTime ( ) , right ) ; else if ( left instanceof TimeZone ) return compare ( ( ( TimeZone ) left ) , right ) ; else { return error ( false , true ) ; } }
compares two Objects