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)

static int intMax(Collection c, S field) {
  int max = Int.MIN_VALUE;
  for (O o : c)
    max = Math.max(max, toInt(getOpt(o, field)));
  ret max;
}

static int intMax(Iterable<Int> l) {
  int max = Int.MIN_VALUE;
  fOr (int i : l)
    max = Math.max(max, i);
  ret max;
}

static int intMax(int... l) {
  int max = Int.MIN_VALUE;
  if (l != null) for (int i : l)
    max = Math.max(max, i);
  ret max;
}

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: 541 / 556
Version history: 2 change(s)
Referenced in: [show references]