[concurrency-interest] Re: AtomicInteger and AtomicLong should implement Number
9 Jan 2004 01:07:10 -0000
> Given that we are not going to change the names, superclasses,
> etc of the AtomicX classes, can anyone suggest some additional
> wording we can put in the package documentation to make sure
> people are not confused about them?
I think it would help me to have something to the effect of:
The role of an AtomicInteger object is to provide separation
of concerns between representation of a numeric value and
concurrent access to that value. In performing this role,
an AtomicInteger object is analogous to an int /variable/,
not an int /value/, and consequently an AtomicInteger object
is not itself directly convertible or comparable to an int
value, an Integer, a Number, or any kind of value. However
the value of the variable represented by the AtomicInteger
object is always immediately available via the get() method.
If I may presume to express an opinion based on "taste", if it was
up to me to simply decide yes/no without any further comment about
whether or not AtomicInteger will extend Number (or Integer for that
matter), I would say unequivocally _no_ it will not. However my
reasoning would have nothing to do with whether or not AtomicInteger
objects and numeric values should be homologous, because I very much
think they should be; I just think "Number" is a turd and I would
not want to smell its stink on AtomicInteger.