Re: iterating the difference of two collections
"Daniel Dyer" <"You don't need it"> wrote in message
news:op.tluh4ktm8kxvgr@cgl0656.chaucer.co.uk...
On Mon, 08 Jan 2007 16:49:53 -0000, Mike Schilling
<mscottschilling@hotmail.com> wrote:
"John Ersatznom" <j.ersatz@nowhere.invalid> wrote in message
news:ent3hr$slf$1@aioe.org...
Mike Schilling wrote:
"Andreas Leitgeb" <avl@gamma.logic.tuwien.ac.at> wrote in message
news:slrneq1hge.bo9.avl@gamma.logic.tuwien.ac.at...
Mike Schilling <mscottschilling@hotmail.com> wrote:
public class Subset extends AbstractSet implements Set {
Btw., is there a reason for "implements Set", when AbstractSet
already does it?
Documentation.
The class name contains "set". It extends a class whose name contains
"Set". "All implemented interfaces" will include "Set". What more
documentation do you want? ;)
An explicit statment that it implements Set. If you can show any
disadvantage to that, I'll reconsider :-)
I don't have a real problem with it, but I'll argue against it anyway...
It's redundant. You are not restating any of the other things that are
being inherited from the base class, so why make an exception for this
interface? To be consistent you ought to also list Iterable and possibly
even Collection in the implements list.
Set implies those two, of course, and the fact that Subset implements Set is
part of its interface. The fact that I'm implementing Subset by subclassing
AbstractSet is an implementation detail. Should I decide, during the
implementation, that I'd rather implement it a different way, I'd need to
change
Subset extends AbstractSet
to
Subset implements Set
It's simpler and safer to say
Subset extends AbstractSet implements Set
in the first place