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

20
LINES

< > BotCompany Repo | #1006065 // intMax - max of field of list << great wording

JavaX fragment (include)

1  
static int intMax(Collection c, S field) {
2  
  int max = Int.MIN_VALUE;
3  
  for (O o : c)
4  
    max = Math.max(max, toInt(getOpt(o, field)));
5  
  ret max;
6  
}
7  
8  
static int intMax(Iterable<Int> l) {
9  
  int max = Int.MIN_VALUE;
10  
  fOr (int i : l)
11  
    max = Math.max(max, i);
12  
  ret max;
13  
}
14  
15  
static int intMax(int... l) {
16  
  int max = Int.MIN_VALUE;
17  
  if (l != null) for (int i : l)
18  
    max = Math.max(max, i);
19  
  ret max;
20  
}

Author comment

Began life as a copy of #1006064

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006065
Snippet name: intMax - max of field of list << great wording
Eternal ID of this version: #1006065/3
Text MD5: 988fbc5862176038e9c7e060e14354be
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-03 03:07:02
Source code size: 423 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 522 / 540
Version history: 2 change(s)
Referenced in: [show references]