On Mon, 2003-09-08 at 16:08, Arun Thomas wrote:
> I'm not sure if it makes sense to call it an "entry that maps to null" but consider 
> that the the cardinal map returned by this function will be accessed in the 
> following manner:
> 
>  Integer x = returnedMap.get(obj);
> 
> That statement may just be pointing out that instead of returning Integer(0) for 
> objects that weren't in the collection, a null will be returned instead - as you 
> pointed out, an object not in the collection will not be mapped to anything, and so, 
> when used as a key, will lead to a null value.  
> 

Yep, the comment is useful in the context getFreq ( Object, Map ).

BTW, a possible optimization of getFreq would to remove the use of
exception handling as part of the expected code path and test for null
explicitly.

-Janek

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to