Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Binary Search Date: Sat, 02 Apr 2011 11:11:30 -0400 Organization: albasani.net Lines: 16 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net BPhzmu485d28gPdb9/UjmnH0UaQEtdq9tzkp4zB9Dqi3XmmyU71GftzEfrVTy/U+/mk2ycqQ4dLss5vE70ug4A== NNTP-Posting-Date: Sat, 2 Apr 2011 15:11:28 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="1jhvhBOGGAOj/w8ewZGWcnVq0LaJbg/mjfZv6P91gDwK5X24koXDxS+Ca6fr8zkqcDAoPZwl6bz41RG1GppMYC1kzWGU+wRhJiYXfN800TPCSHv42oo5DTdZRisilqKN"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: Cancel-Lock: sha1:1W6lwC1kTcnTitJ4KngYE1tY0Ho= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2760 Mike Schilling wrote: > "Lawrence D'Oliveiro" wrote: >> So why isn’t there a single-argument overload of the put method to save you >> the trouble? > > There is, if you use a Set instead of a Map. Which, for sorting, works equally > well. In the standard API, HashSet is implemented as a Map under the hood, as is TreeSet. "Lawrence" could spend its time profitably by studying the Javadocs. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg