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

32
LINES

< > BotCompany Repo | #1002042 - keys function

JavaX fragment (include)

1  
static <A, B> Set<A> keys(Map<A, B> map) {
2  
  ret map == null ? new HashSet : map.keySet();
3  
}
4  
5  
// convenience shortcut for keys_gen
6  
static Set keys(O map) {
7  
  ret keys((Map) map);
8  
}
9  
10  
ifclass MultiSet
11  
  static <A> Set<A> keys(MultiSet<A> ms) {
12  
    ret ms.keySet();
13  
  }
14  
endif
15  
16  
ifclass MultiMap
17  
  static <A, B> Set<A> keys(MultiMap<A, B> mm) {
18  
    ret mm.keySet();
19  
  }
20  
endif
21  
22  
ifclass MultiSetMap
23  
  static <A, B> Set<A> keys(MultiSetMap<A, B> mm) {
24  
    ret mm.keySet();
25  
  }
26  
endif
27  
28  
ifclass SmallestListMultiMap
29  
  static <A, B> Set<A> keys(SmallestListMultiMap<A, B> mm) {
30  
    ret mm.keySet();
31  
  }
32  
endif

download  show line numbers  debug dex  old transpilations   

Travelled to 20 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, dpqxeycirhfy, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, podlckwnjdmb, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, whxojlpjdney, xrpafgyirdlv, yanjaxplzisb

No comments. add comment

Snippet ID: #1002042
Snippet name: keys function
Eternal ID of this version: #1002042/7
Text MD5: 5a44db6881fb884534695b377aa52fab
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-13 18:50:39
Source code size: 627 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 608 / 2863
Version history: 6 change(s)
Referenced in: [show references]