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

19
LINES

< > BotCompany Repo | #1008373 // lookupByNLMatch

JavaX fragment (include)

static <A> A lookupByNLMatch(Map<S, A> map, S s) {
  ret lookupByNLMatch(map, s, null);
}

static <A> A lookupByNLMatch(Map<S, A> map, S s, Matches m) {
  for (S key : keys(map))
    if (match(key, s, m))
      ret map.get(key);
  null;
}

ifclass MultiMap
static <A> L<A> lookupByNLMatch(MultiMap<S, A> map, S s) {
  for (S key : keys(map))
    if (match(key, s))
      ret map.get(key);
  ret emptyList();
}
endif

Author comment

Began life as a copy of #1002107

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008373
Snippet name: lookupByNLMatch
Eternal ID of this version: #1008373/6
Text MD5: 86ec7a73d03a49a60576fa37fc0f862c
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-27 20:09:26
Source code size: 433 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 519 / 570
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1008379 - lookupByNLFind
#1012505 - lookupAllByNLMatch
#1014430 - lookupNL - synonym of lookupByNLMatch