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

16
LINES

< > BotCompany Repo | #1019135 // syncMap - clone map and map over that; also: make a synchronized HashMap (or other map)

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

Libraryless. Click here for Pure Java version (2610L/16K).

static L syncMap(O f, Map map) {
  ret syncMap(map, f);
}

// map: func(key, value) -> list element
static L syncMap(Map map, O f) {
  ret map(cloneLinkedHashMap(map), f); // TODO: use a temporary list instead
}

static <A, B> Map<A, B> syncMap() {
  ret synchroHashMap();
}

static <A, B> Map<A, B> syncMap(Map map) {
  ret synchronizedMap(map);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019135
Snippet name: syncMap - clone map and map over that; also: make a synchronized HashMap (or other map)
Eternal ID of this version: #1019135/7
Text MD5: fa2a77a9ad6889872b5b387add2fa553
Transpilation MD5: 16a0016494ebeddbcf852f8966e11489
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-04-15 01:09:41
Source code size: 363 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 370 / 519
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)