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

5
LINES

< > BotCompany Repo | #1002300 // setAdd

JavaX fragment (include)

static <A> bool setAdd(Collection<A> c, A a) {
  if (c == null || c.contains(a)) false;
  c.add(a);
  ret true;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, elmgxqgtpvxh, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002300
Snippet name: setAdd
Eternal ID of this version: #1002300/2
Text MD5: 2c920fc0041f811235bd274e6ba61d46
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-09 08:33:24
Source code size: 117 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 766 / 1623
Version history: 1 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1009410 - addIfNotThere - synonym of setAdd
#1009464 - setAdd_remove - set-add to one collection, remove from another
#1035262 - syncSetAdd - synchronized add to collection if element isn't there
#3000382 - Answer for ferdie (>> t = 1, f = 0)