Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1022258 // nValuesFromMultiMapByKeyDesc

JavaX fragment (include)

static <A, B> L<B> nValuesFromMultiMapByKeyDesc(int n, MultiMap<A, B> mm) {
  new L<B> out;
  for (A key : keysDesc(mm)) {
    int need = n-l(out);
    out.addAll(takeFirst(need, mm.get(key)));
    if (l(out) >= n) break;
  }
  ret out;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022258
Snippet name: nValuesFromMultiMapByKeyDesc
Eternal ID of this version: #1022258/2
Text MD5: 744c937d37f74822d8204c9eb9ff80e1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-12 12:39:47
Source code size: 246 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 303 / 323
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)