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).

1  
// TODO: comparators!?
2  
static MultiMap similarEmptyMultiMap(MultiMap m) {
3  
  if (m cast TreeMultiMap)
4  
    ret new TreeMultiMap(m);
5  
  ret similarEmptyMultiMap(m?.data);
6  
}
7  
8  
static MultiMap similarEmptyMultiMap(Map m) {
9  
  new MultiMap mm;
10  
  if (m != null)
11  
    mm.data = similarEmptyMap(m);
12  
  ret mm;
13  
}

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: 302 / 407
Version history: 3 change(s)
Referenced in: [show references]