You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Henri Yandell <ba...@generationjava.com> on 2002/10/30 04:46:44 UTC

[collections] CursorableLinkedList

Any reason why this class isn't a LinkedList? [ie extends it].

>From the name I would quite happily expect to do:

LinkedList list = new CursorableLinkedList()  etc.

Just a thought I had while going over the javadoc.

Hen


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collections] CursorableLinkedList

Posted by "Michael A. Smith" <ma...@apache.org>.
Henri Yandell wrote:
> Just the naming convention. I tend to assume that:
> 
> XXxxMap   is a generic map.
> XxxxHashMap is a map that uses a Hash and furthermore is also a HashMap.

I'll agree with you on the using a hash part, but I disagree on the "is 
also a" part.

> It's nice to be able to tell XXxxxMap to use a HashMap internally if I
> have the chance. 

I'm a bit confused by what you're saying here.  Making some assumptions, 
I'll agree that it's nice to know that the map is using a hash based 
algorithm, but why should I care whether that hash based algorithm is 
implemented as a java.util.HashMap?

 > Both MultiHashMap and FastHashMap follow this naming
> convention.

MultiHashMap uses the implementation provided by HashMap, so it makes 
sense for it to extend HashMap (i.e. it's just extending the 
functionality).

As for FastHashMap, I don't know why it extends HashMap (probably legacy 
reasons).  It fully implements the Map API directly without extending 
any functionality provided by HashMap, so it probably should have done 
what both SequencedHashMap and SoftRefHashMap do and just implement the 
java.util.Map interface while not extending anything.

> So I'd expect same to hold for CursLinkedList.

that what holds the same?  that it's using a linked list internally 
(which it does), or that it's using a LinkedList internally (which it 
does not).

> It's not a biggy, just a comment in case anyone thinks it might be
> important.

ok.  :)

> Does XxxxHashMap merely imply it's a Map, with some kind of Hash?
> Probably.

yup.  A map that uses a hash based algorithm for lookups.

 > Hen

regards,
michael

> 
> On Tue, 29 Oct 2002, Michael A. Smith wrote:
> 
> 
>>On Tue, 29 Oct 2002, Henri Yandell wrote:
>>
>>>Any reason why this class isn't a LinkedList? [ie extends it].
>>>
>>>>From the name I would quite happily expect to do:
>>>
>>>LinkedList list = new CursorableLinkedList()  etc.
>>>
>>>Just a thought I had while going over the javadoc.
>>
>>Any particular reason why it should extend java.util.LinkedList?  It
>>doesn't buy you anything to cast it to LinkedList (might as well just
>>cast it to List).
>>
>>regards,
>>michael
>>

-- 
Michael A. Smith
mas@apache.org



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collections] CursorableLinkedList

Posted by Henri Yandell <ba...@generationjava.com>.
Just the naming convention. I tend to assume that:

XXxxMap   is a generic map.
XxxxHashMap is a map that uses a Hash and furthermore is also a HashMap.

It's nice to be able to tell XXxxxMap to use a HashMap internally if I
have the chance. Both MultiHashMap and FastHashMap follow this naming
convention.

So I'd expect same to hold for CursLinkedList.

It's not a biggy, just a comment in case anyone thinks it might be
important.

Does XxxxHashMap merely imply it's a Map, with some kind of Hash?
Probably.

Hen

On Tue, 29 Oct 2002, Michael A. Smith wrote:

> On Tue, 29 Oct 2002, Henri Yandell wrote:
> > Any reason why this class isn't a LinkedList? [ie extends it].
> >
> > From the name I would quite happily expect to do:
> >
> > LinkedList list = new CursorableLinkedList()  etc.
> >
> > Just a thought I had while going over the javadoc.
>
> Any particular reason why it should extend java.util.LinkedList?  It
> doesn't buy you anything to cast it to LinkedList (might as well just
> cast it to List).
>
> regards,
> michael
>
> --
> Michael A. Smith
> mas@apache.org
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [collections] CursorableLinkedList

Posted by "Michael A. Smith" <ma...@apache.org>.
On Tue, 29 Oct 2002, Henri Yandell wrote:
> Any reason why this class isn't a LinkedList? [ie extends it].
> 
> From the name I would quite happily expect to do:
> 
> LinkedList list = new CursorableLinkedList()  etc.
> 
> Just a thought I had while going over the javadoc.

Any particular reason why it should extend java.util.LinkedList?  It 
doesn't buy you anything to cast it to LinkedList (might as well just 
cast it to List).  

regards,
michael

-- 
Michael A. Smith
mas@apache.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>