On Fri, 19 Oct 2001, Mark A. Belonga wrote: > java.lang.Number is an abstract class. We need to make an instance of the > object. We can refer to the Double elsewhere as a Number, but we still need > to instantiate it as something concrete (such as Double or Integer).
I'm just guessing, but I think we should keep the separation between Double and Integer, but add some logic to do automagic widening, like the JVM itself does for comparison. Legal conversion/promotions: short -> int -> long -> float -> double I think. In other systems I've done, we had logic roughly: if ( eitherIsDouble( lhs, rhs ) ) { return compare( lhs.doubleValue(), rhs.doubleValue() ); } if ( eitherIsFloat( lhs, rhs ) ) { return compare( lhs.floatValue(), rhs.floatValue() ); } if ( eitherIsLong( lhs, rhs ) ) { return comapre( lhs.longValue(), rhs.longValue() ); } ... etc ... If we turn all numbers into doubles, then string(...) would be bogus, if you pass it something you think is an integer, but get back "42.0" instead of just "42". -bob _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest