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 (41L/1K).

static <A, B> Set<A> keys(Map<A, B> map) {
  ret map == null ? new HashSet : map.keySet();
}

// convenience shortcut for keys_gen
static Set keys(O map) {
  ret keys((Map) map);
}

ifclass MultiSet
  static <A> Set<A> keys(MultiSet<A> ms) {
    ret ms.keySet();
  }
endif

ifclass IMultiMap
  static <A, B> Set<A> keys(IMultiMap<A, B> mm) {
    ret mm.keySet();
  }
endif

ifclass SmallestListMultiMap
  static <A, B> Set<A> keys(SmallestListMultiMap<A, B> mm) {
    ret mm.keySet();
  }
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/8
Text MD5: a439faf83aa05376275213343f6b5e26
Transpilation MD5: 087b071a333d66a277fc75a5d1b5fe58
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-11 07:30:07
Source code size: 519 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 703 / 3000
Version history: 7 change(s)
Referenced in: [show references]