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

14
LINES

< > BotCompany Repo | #1004963 // sortedByFieldIgnoreCase

JavaX fragment (include)

1  
static <A> L<A> sortedByFieldIgnoreCase(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 compareIgnoreCase(unnull((S) getOpt(a, field)),
6  
        unnull((S) getOpt(b, field)));
7  
    }
8  
  });
9  
  ret l;
10  
}
11  
12  
static <A> L<A> sortedByFieldIgnoreCase(S field, Collection<A> c) {
13  
  ret sortedByFieldIgnoreCase(c, field);
14  
}

Author comment

Began life as a copy of #1002452

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004963
Snippet name: sortedByFieldIgnoreCase
Eternal ID of this version: #1004963/1
Text MD5: 9fd4a8ead2ba030cb9e133de47b1b183
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-09-18 18:53:44
Source code size: 414 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 590 / 616
Referenced in: [show references]