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

13
LINES

< > BotCompany Repo | #1020214 // similarEmptyMultiMap - make an effort to create an empty MultiMap of same type

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

Libraryless. Click here for Pure Java version (4528L/25K).

// TODO: comparators!?
static MultiMap similarEmptyMultiMap(MultiMap m) {
  if (m cast TreeMultiMap)
    ret new TreeMultiMap(m);
  ret similarEmptyMultiMap(m?.data);
}

static MultiMap similarEmptyMultiMap(Map m) {
  new MultiMap mm;
  if (m != null)
    mm.data = similarEmptyMap(m);
  ret mm;
}

Author comment

Began life as a copy of #1004367

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020214
Snippet name: similarEmptyMultiMap - make an effort to create an empty MultiMap of same type
Eternal ID of this version: #1020214/4
Text MD5: 0f3e91896083414f796230aa1808d433
Transpilation MD5: ae6763952e1807fb7c5b286f7f970d68
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-23 00:58:37
Source code size: 309 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 300 / 404
Version history: 3 change(s)
Referenced in: [show references]