commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
Subject Re: [lang] MutableNumber (WAS: RE: [lang] Mutable type casts and MutableNumber)
Date Sat, 02 Oct 2004 23:22:21 GMT
This sounds like we should add the missing methods. MutableNumber is only
worth adding if someone is going to hold a variable reference as a mutable
Number, and I can't see the use case for that (over and above mutable


From: "Gary Gregory" <>
In particular, Number declares all of the conversion methods like
byteValue(), intValue(), etc. Number provides default implementation for
byteValue() and shortValue() while other conversion methods are

If you look at MutableByte, you see for example byteValue() and
doubleValue(). But if you look at MutableDouble, you see doubleValue()
but no byteValue(), which is inconsistent. Having a superclass which
parallels Number would formalize and enforce these contracts.

There are such inconsistencies in all the Mutable classes :-(

IMHO this is a positive argument for MutableNumber (or AbstractNumber if
you prefer to keep MutableNumber as an interface).


> -----Original Message-----
> From: Stephen Colebourne []
> Sent: Thursday, September 30, 2004 16:15
> To: Jakarta Commons Developers List
> Subject: Re: [lang] Mutable type casts and MutableNumber
> From: "matthew.hawthorne" <>
> > Gary Gregory wrote:
> > > 1st minor: there are a bunch of unnecessary type-casts, I'd like
> > > remove those if no one objects.
> +1
> > > 2nd: There is no MutableNumber class. It seems to me that the
> > > number classes are paralle to java.lang.Number classes and should
> > > therefore also be subclasssed from a MutableNumber.
> >
> > Originally, there was such a class, but after some analysis and
> > refactoring, it wasn't really doing anything and was nominated for
> > removal.  However, I understand your point.  If MutableNumber were
to be
> > resurrected, it would serve only as a marker interface.  I'm fine
> that.
> -1, we shouldn't add classes that don't add value to lang.
> Stephen
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message