MCPcopy Create free account
hub / github.com/Card-Forge/forge / max

Method max

forge-core/src/main/java/forge/util/Aggregates.java:17–27  ·  view source on GitHub ↗
(final Iterable<T> source, final Function<T, Integer> valueAccessor)

Source from the content-addressed store, hash-verified

15
16 // Returns the value matching predicate conditions with the maximum value of whatever valueAccessor returns.
17 public static final <T> Integer max(final Iterable<T> source, final Function<T, Integer> valueAccessor) {
18 if (source == null) { return null; }
19 int max = Integer.MIN_VALUE;
20 for (final T c : source) {
21 int value = valueAccessor.apply(c);
22 if (value > max) {
23 max = value;
24 }
25 }
26 return max;
27 }
28
29 public static Integer max(final Iterable<Integer> source) {
30 if (source == null) return null;

Callers 15

addExtraKeywordCostMethod · 0.95
maxMethod · 0.95
calculateAmountMethod · 0.95
getCardPreferenceMethod · 0.95
isWorseThanDrawMethod · 0.95
filterLandsToPlayMethod · 0.95
doManaRitualLogicMethod · 0.95
doChargeToCMCLogicMethod · 0.95

Calls 1

applyMethod · 0.65

Tested by

no test coverage detected