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

19
LINES

< > BotCompany Repo | #1008373 // lookupByNLMatch

JavaX fragment (include)

1  
static <A> A lookupByNLMatch(Map<S, A> map, S s) {
2  
  ret lookupByNLMatch(map, s, null);
3  
}
4  
5  
static <A> A lookupByNLMatch(Map<S, A> map, S s, Matches m) {
6  
  for (S key : keys(map))
7  
    if (match(key, s, m))
8  
      ret map.get(key);
9  
  null;
10  
}
11  
12  
ifclass MultiMap
13  
static <A> L<A> lookupByNLMatch(MultiMap<S, A> map, S s) {
14  
  for (S key : keys(map))
15  
    if (match(key, s))
16  
      ret map.get(key);
17  
  ret emptyList();
18  
}
19  
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: 520 / 571
Version history: 5 change(s)
Referenced in: [show references]