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

David Holmes dholmes@dltech.com.au
Mon, 5 Jan 2004 16:29:44 +1000


> I would call a subtype of class X, "a kind of X", and I think it
> would be correct to say an instance of that subtype "is" an X, in
> the "Liskov Substitution Principle" sense.

Sorry I didn't make the point very clearly, the original argument
went:

AtomicInteger is a kind of Integer
Integer is a kind of Number
=> AtomicInteger is a kind of Number

eg. class AtomicInteger extends/implements Number { ... }

where the more direct inference would simply be that:

 class AtomicInteger extends Integer

(and thereby is also a Number).


I wish that generics could have made this naming issue moot. :(

David Holmes