commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Smith" <...@apache.org>
Subject Re: [collections] CursorableLinkedList
Date Wed, 30 Oct 2002 04:57:10 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message