From ad7f945d6f724d51ee843b334838fda84c6197f2 Mon Sep 17 00:00:00 2001 From: Danielshe Date: Sun, 3 Nov 2019 19:02:00 +0800 Subject: API Changes --- .../me/shedaniel/rei/utils/CollectionUtils.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/main/java/me/shedaniel/rei/utils/CollectionUtils.java') diff --git a/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java b/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java index 1db59e54e..d2b7eb92a 100644 --- a/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java +++ b/src/main/java/me/shedaniel/rei/utils/CollectionUtils.java @@ -1,3 +1,8 @@ +/* + * Roughly Enough Items by Danielshe. + * Licensed under the MIT License. + */ + package me.shedaniel.rei.utils; import me.shedaniel.rei.api.EntryStack; @@ -151,6 +156,14 @@ public class CollectionUtils { return sum; } + public static final int sumInt(List list) { + int sum = 0; + for (Integer t : list) { + sum += t; + } + return sum; + } + public static final double sumDouble(List list, Function function) { double sum = 0; for (T t : list) { @@ -158,4 +171,12 @@ public class CollectionUtils { } return sum; } + + public static final double sumDouble(List list) { + double sum = 0; + for (Double t : list) { + sum += t; + } + return sum; + } } -- cgit