[concurrency-interest] Re: AtomicInteger and AtomicLong should implement Number

Larry Riedel larryr@saturn.sdsu.edu
9 Jan 2004 07:15:13 -0000


> I would point out that this entire thread is predicated on 
> taste: the idea that AtomicInteger must be a kind of Integer
> because of its name.

???

My impression is there is a feeling that if the raison d'etre of an
object in a system is to be the custodian of a single numeric value,
it would be nice if it provided access to the value in a way which is
consistent with other objects in the system which perform that role.

For developing software which would read the value in a context
where the modification semantics for the value are irrelevant, I
would not care what is the name of the class which was used to
instantiate the object (eg AtomicInteger) if I could reference
it through a variable whose type is an ancestor of it, a type
whose purpose is to directly represent numeric values.

In the case of AtomicInteger, it appears there will be no such
ancestor type.  My impression is that this thread is about the
desirability of accessing the numeric value through a variable
of a single type which is universally used to represent numeric
values directly (if there was such a type).


Larry