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

26
LINES

< > BotCompany Repo | #1002042 // keys function

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (44L/1K).

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 == null ?: ms.keySet();
13  
  }
14  
endif
15  
16  
ifclass IMultiMap
17  
  static <A, B> Set<A> keys(IMultiMap<A, B> mm) {
18  
    ret mm == null ?: mm.keySet();
19  
  }
20  
endif
21  
22  
ifclass SmallestListMultiMap
23  
  static <A, B> Set<A> keys(SmallestListMultiMap<A, B> mm) {
24  
    ret mm == null ?: mm.keySet();
25  
  }
26  
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/9
Text MD5: a887d51e0db3d8f0370489a1447bbc42
Transpilation MD5: ea3b069d9eb25bd5a8cb2e5b2fdbfd49
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2024-01-04 18:44:49
Source code size: 561 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 886 / 3249
Version history: 8 change(s)
Referenced in: [show references]