3-ftransform-forecasting #5

Open
romanov73 wants to merge 27 commits from 3-f-transform into master
Showing only changes of commit 682370f3da - Show all commits

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
public class TimeSeries { public class TimeSeries {
@ -90,14 +91,14 @@ public class TimeSeries {
public TimeSeriesValue getMax() { public TimeSeriesValue getMax() {
if ((values.size() > 0)) { if ((values.size() > 0)) {
return values.stream().max((o1, o2) -> o1.getValue().compareTo(o2.getValue())).get(); return values.stream().max(Comparator.comparing(TimeSeriesValue::getValue)).get();
} }
throw new RuntimeException("Временной ряд пустой"); throw new RuntimeException("Временной ряд пустой");
} }
public TimeSeriesValue getMin() { public TimeSeriesValue getMin() {
if ((values.size() > 0)) { if ((values.size() > 0)) {
return values.stream().min((o1, o2) -> o1.getValue().compareTo(o2.getValue())).get(); return values.stream().min(Comparator.comparing(TimeSeriesValue::getValue)).get();
} }
throw new RuntimeException("Временной ряд пустой"); throw new RuntimeException("Временной ряд пустой");
} }