Question on layer/peeling
Ali Ebrahimi
ali.ebrahimi1781 at gmail.com
Wed Jan 7 08:03:04 UTC 2015
Or add method
Map.Entry<K,V> getEntry(key)
On Wed, Jan 7, 2015 at 2:15 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> By the way, C# solves this by having TryGet type of methods that return a
>> boolean indicating success (I.e. found mapping) and set an out parameter
>> to
>> the value found. You'd need a lightweight tuple or multi return to do the
>> same in java, I think.
>>
>
> Right, there's two ways to fix get():
> - Using the getOrDefault(key, sentinel) // added in Java 8
> - Using some sort of optional-like return type
>
> Not quite at that part of the road yet.
>
>
--
Best Regards,
Ali Ebrahimi
More information about the valhalla-dev
mailing list