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

David Holmes dholmes@dltech.com.au
Mon, 5 Jan 2004 15:36:51 +1000


Larry Riedel wrote:
> Speaking only for myself, from my exposure to, I guess 1000s of
> class/interface/type names, and a few nearly ubiquitous naming
> patterns/conventions, I can imagine someone seeing
> "AtomicInteger" and "AtomicLong" and expecting/inferring they are a
kind of
> Integer and Long, respectively.

I agree that seeing the name alone might lead to that inference -
though it would seem more likely to lead to the inference that AtomicX
is a subtype of class X. My query was based on the premise that the
person asking the question was familiar with the descriptions of all
classes involved.

It would perhaps have been better to use AtomicInt rather than
AtomicInteger, and perhaps even better to use AtomicXValue as you
suggested. But I would hope that reading the class docs will quickly
dispel any confusion without the need to rename these classes at this
stage.

David Holmes