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

11
LINES

< > BotCompany Repo | #1019637 // combineComparators

JavaX fragment (include)

static <A> Comparator<A> combineComparators(final Comparator<A>... l) {
  ret new Comparator<A> {
    public int compare(A a, A b) {
      for (Comparator<A> c : l) {
        int i = c.compare(a, b);
        if (i != 0) ret i;
      }
      ret 0;
    }
  };
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019637
Snippet name: combineComparators
Eternal ID of this version: #1019637/3
Text MD5: e0cf19e3e4264a94a9be5c08a3f93aec
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-15 03:30:15
Source code size: 270 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 393 / 448
Version history: 2 change(s)
Referenced in: [show references]