Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #16943

Re: SortedMap: getting value for largest key less or equal a given value...

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: SortedMap: getting value for largest key less or equal a given value...
Date Wed, 01 Aug 2012 14:48:20 -0700
Organization A noiseless patient Spider
Lines 25
Message-ID <jvc875$7ik$1@dont-email.me> (permalink)
References <slrnk1j1r3.u9l.avl@gamma.logic.tuwien.ac.at> <slrnk1j3qr.u9l.avl@gamma.logic.tuwien.ac.at>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Wed, 1 Aug 2012 21:48:22 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="61282af8d6595e8d991edb5ac03d6e00"; logging-data="7764"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++SfVOduHadY/sL4LRQ81A+DItA4cUA6A="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0
In-Reply-To <slrnk1j3qr.u9l.avl@gamma.logic.tuwien.ac.at>
Cancel-Lock sha1:nmFlBrj7ZJKctbcQyz21EL8VAjk=
Xref csiph.com comp.lang.java.programmer:16943

Show key headers only | View raw


On 8/1/2012 1:19 PM, Andreas Leitgeb wrote:
> Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> wrote:
>> I've got an approach like the following, but I'm not entirely
>> happy with it...
>
> It took me about an hour to compose that previous post, and not
> only did a bug still hide in it ("map" instead of "m_map"), but
> also: only five minutes after posting, it occurred to me that I
> could also look at TreeMap's methods, rather than only at
> SortedMap's, and thereby stumbled over the (new in 1.6) interface
> NavigableMap.
>
> PS: return m_map.floorEntry(k).getValue(); // :-)
> Case closed.


It is my contention that any requests for help should contain a careful 
explanation of the problem and attempted solutions, plus an SSCCE.  Then 
the author should save the request on disc and go to lunch.  If no 
solution was discovered during lunch, then the request should be sent.

I think there's a Dilbert cartoon about this.


Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

SortedMap: getting value for largest key less or equal a given value... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-08-01 19:45 +0000
  Re: SortedMap: getting value for largest key less or equal a given value... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-08-01 20:19 +0000
    Re: SortedMap: getting value for largest key less or equal a given value... markspace <-@.> - 2012-08-01 14:48 -0700
      Re: SortedMap: getting value for largest key less or equal a given value... Roedy Green <see_website@mindprod.com.invalid> - 2012-08-02 01:20 -0700
        Re: SortedMap: getting value for largest key less or equal a given value... Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-08-02 09:53 -0700
          Re: SortedMap: getting value for largest key less or equal a given value... Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-08-03 00:55 +0000

csiph-web