make the code that determines which axis to use explicit

In the previous changeset the code that determined
which axis the plots used was implemented as a
side effect of getting the Gnuplot definition of
an axis.
Changed that to an explit update call with simpler
logic.
This commit is contained in:
2019-11-24 09:08:19 +01:00
parent 892d5a6d08
commit e2a33ac6e2
8 changed files with 119 additions and 58 deletions

View File

@@ -2,6 +2,8 @@ package org.lucares.utils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -37,6 +39,12 @@ public class CollectionUtils {
}
public static <T> List<T> copySort(Collection<? extends T> collection, Comparator<T> comparator){
final List<T> result = new ArrayList<T>(collection);
Collections.sort(result, comparator);
return result;
}
public static <T, R extends T> void mapInPlace(final List<T> list, final Function<T, R> mapper) {
for (int i = 0; i < list.size(); i++) {
final T value = list.get(i);