commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rich Dougherty" <r...@rd.gen.nz>
Subject Re: [collections] [patch] changes for ArrayListIterator was: Re: [collections] private member access in o.a.c.collections.iterators
Date Tue, 10 Dec 2002 19:22:13 GMT
> Also, I am very uncomfortable with ArrayListIterator being a subclass of
> UnmodifiableArrayListIterator. There is no 'is a' relationship here, and
> worse, if I declared a method to take in an
> UnmodifiableArrayListIterator it would accept a modifiable one which
> would probably not be what I want.

I have seen this sort of thing done before. For example, in the JODA Time
library, ReadableWritableInstant (mutable) extends ReadableInstant
(immutable). :-)

However, I agree with you in this case. Using the word "unmodifiable"
implies that subclasses will be immutable, whereas "readable" only
suggests that subclasses will be able to read its value.

Rich



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message