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

12
LINES

< > BotCompany Repo | #1007722 // prioritizeList - drag certain elements to front

JavaX fragment (include)

static <A> L<A> prioritizeList(Collection<A> c, L<A> prioritizer) {
  new L<A> l;
  Set<A> set = asSet(c);
  for (A a : prioritizer) {
    if (set.contains(a)) {
      set.remove(a);
      l.add(a);
    }
  }
  l.addAll(set);
  ret l;
}

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: #1007722
Snippet name: prioritizeList - drag certain elements to front
Eternal ID of this version: #1007722/3
Text MD5: 8b25519aecac3f546bc9783198211f52
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-02 23:12:04
Source code size: 247 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 577 / 567
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)