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

6
LINES

< > BotCompany Repo | #1009464 // setAdd_remove - set-add to one collection, remove from another

JavaX fragment (include)

static <A> bool setAdd_remove(Collection<A> c, Collection<A> d, A a) {
  if (c.contains(a)) { d.remove(a); false; }
  c.add(a);
  d.remove(a);
  true;
}

Author comment

Began life as a copy of #1002300

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009464
Snippet name: setAdd_remove - set-add to one collection, remove from another
Eternal ID of this version: #1009464/3
Text MD5: ea03ec73c1b7afa0c03359ca76ba708f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-03 17:38:27
Source code size: 157 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 339 / 371
Version history: 2 change(s)
Referenced in: [show references]