1 | static <A> L<A> prioritizeList(Collection<A> c, L<A> prioritizer) { |
2 | new L<A> l; |
3 | Set<A> set = asSet(c); |
4 | for (A a : prioritizer) { |
5 | if (set.contains(a)) { |
6 | set.remove(a); |
7 | l.add(a); |
8 | } |
9 | } |
10 | l.addAll(set); |
11 | ret l; |
12 | } |
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: | 578 / 568 |
Version history: | 2 change(s) |
Referenced in: | [show references] |