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


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

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

From "markspace" <markspace@1:261/38.remove-yy0-this>
Subject Re: SortedMap: getting value for largest key less or equal a given
Message-ID <501C1561.56006.calajapr@time.synchro.net> (permalink)
Newsgroups comp.lang.java.programmer
References <501C1561.56005.calajapr@time.synchro.net>
Date 2012-08-03 18:54 +0000
Organization tds.net

Show all headers | View raw


  To: Andreas Leitgeb
From: "markspace" <markspace@1:261/38.remove-s5y-this>

  To: Andreas Leitgeb
From: markspace <-@.>

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.

-+- BBBS/Li6 v4.10 Dada-1
 + Origin: Prism bbs (1:261/38)
-+- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

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


Thread

SortedMap: getting value for largest key less or equal a given "Andreas Leitgeb" <andreas.leitgeb@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
  Re: SortedMap: getting value for largest key less or equal a given "Andreas Leitgeb" <andreas.leitgeb@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000
    Re: SortedMap: getting value for largest key less or equal a given "markspace" <markspace@1:261/38.remove-yy0-this> - 2012-08-03 18:54 +0000

csiph-web