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

12
LINES

< > BotCompany Repo | #1013072 // keysStartingWith2 - returns a set

JavaX fragment (include)

static <A> Collection<S> keysStartingWith2(S prefix, Map<S, A> map) {
  if (empty(prefix)) ret keys(map);
  if (map instanceof NavigableMap) {
    S lastKey = lexicographicallyNextString(prefix);
    ret keys(((NavigableMap) map).subMap(prefix, true, lastKey, false));
  }
  ret startingWith(prefix, keys(map));
}

static <A> Collection<S> keysStartingWith2(Map<S, A> map, S prefix) {
  ret keysStartingWith2(prefix, map);
}

Author comment

Began life as a copy of #1004369

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1013072
Snippet name: keysStartingWith2 - returns a set
Eternal ID of this version: #1013072/4
Text MD5: 7ce4be71f2f26e76d56dfb7f296e7074
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-24 19:41:32
Source code size: 435 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 405 / 433
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1030146 - subMapWithKeysStartingWithIC