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

11
LINES

< > BotCompany Repo | #1018651 // firstKeyAndValue - first key & value of map (as Pair)

JavaX fragment (include)

static <A, B> Pair<A, B> firstKeyAndValue(Map<A, B> map) {
  if (map == null) null;
  Map.Entry<A, B> entry = first(map.entrySet());
  ret entry == null ? null : pair(entry.getKey(), entry.getValue());
}

/*ifclass MultiSetMap
static <A, B> Pair<A, B> firstKeyAndValue(MultiSetMap<A, B> map) {
  if (map == nul) null;
}
endifclass*/

Author comment

Began life as a copy of #1004263

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018651
Snippet name: firstKeyAndValue - first key & value of map (as Pair)
Eternal ID of this version: #1018651/3
Text MD5: 81ed00f74c0c452bed9d0ca23cbffafa
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-11 08:07:37
Source code size: 342 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 364 / 395
Version history: 2 change(s)
Referenced in: [show references]