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

9
LINES

< > BotCompany Repo | #1025196 // addOrCreate - synonym of addDyn + createOrAddToSet

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

Libraryless. Click here for Pure Java version (9250L/51K).

1  
meta-for Cl also as L {
2  
  static <A> Cl<A> addOrCreate(Cl<A> l, A a) {
3  
    ret addDyn(l, a);
4  
  }
5  
}
6  
7  
static <A> Set<A> addOrCreate(Set<A> l, A a) {
8  
  ret createOrAddToSet(l, a);
9  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025196
Snippet name: addOrCreate - synonym of addDyn + createOrAddToSet
Eternal ID of this version: #1025196/4
Text MD5: 43dae1ff85268e96acae433277fd0d81
Transpilation MD5: 96849ed25553c21be1ee5c9bb71cbb34
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-09-01 22:36:00
Source code size: 188 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 286 / 376
Version history: 3 change(s)
Referenced in: [show references]