Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #16943
| From | markspace <-@.> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: SortedMap: getting value for largest key less or equal a given value... |
| Date | 2012-08-01 14:48 -0700 |
| Organization | A noiseless patient Spider |
| 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> |
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 | Next — Previous in thread | Next in thread | Find similar | Unroll 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