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

5
LINES

< > BotCompany Repo | #1022633 // similarEmptyCollection - make an effort to create an empty collection of same type. defaults to list

JavaX fragment (include)

static Collection similarEmptyCollection(Collection c) {
  if (c cast L) ret similarEmptyList(c);
  if (c cast Set) ret similarEmptySet(c);
  ret new L;
}

Author comment

Began life as a copy of #1007943

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1022633
Snippet name: similarEmptyCollection - make an effort to create an empty collection of same type. defaults to list
Eternal ID of this version: #1022633/1
Text MD5: 045cabe8e24ddc3ba294dd4a366ee72b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-25 13:40:01
Source code size: 158 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 288 / 330
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)