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

7
LINES

< > BotCompany Repo | #1006201 - setAddOrMoveToEnd

JavaX fragment (include)

static <A> bool setAddOrMoveToEnd(L<A> l, A a) {
  int i = l.indexOf(a);
  if (i >= 0 && i == l(l)-1) false;
  if (i >= 0) l.remove(i);
  l.add(a);
  true;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006201
Snippet name: setAddOrMoveToEnd
Eternal ID of this version: #1006201/1
Text MD5: 5ff65987957e7351c9fcfef5e185d7e0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-23 03:27:25
Source code size: 163 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 358 / 351
Referenced in: [show references]