1 | static <A> L<A> sortedByField(Collection<A> c, final S field) { |
2 | L<A> l = new ArrayList(c); |
3 | sort(l, new Comparator<A>() { |
4 | public int compare(A a, A b) { |
5 | ret cmp(getOpt(a, field), getOpt(b, field)); |
6 | } |
7 | }); |
8 | ret l; |
9 | } |
10 | |
11 | static <A> L<A> mapMethodLike sortedByField(S field, Collection<A> c) { |
12 | ret sortedByField(c, field); |
13 | } |
Began life as a copy of #1002319
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: | #1002452 |
Snippet name: | sortedByField |
Eternal ID of this version: | #1002452/2 |
Text MD5: | 9f6d74be958833b82b6b1bfbd2ba4987 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-05-11 13:43:18 |
Source code size: | 351 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 825 / 837 |
Version history: | 1 change(s) |
Referenced in: | [show references] |