+ * Constructor given ranges as lists of [start, end] positions
+ *
+ * @param fromRange
+ * @param toRange
+ * @param fromRatio
+ * @param toRatio
+ */
+ public MapList(List<int[]> fromRange, List<int[]> toRange,
+ int fromRatio, int toRatio)
+ {
+ this.fromShifts = fromRange;
+ this.toShifts = toRange;
+ this.fromRatio = fromRatio;
+ this.toRatio = toRatio;
+
+ fromLowest = Integer.MAX_VALUE;
+ fromHighest = 0;
+ for (int[] range : fromRange) {
+ fromLowest = Math.min(fromLowest, range[0]);
+ fromHighest = Math.max(fromHighest, range[1]);
+ }
+
+ toLowest = Integer.MAX_VALUE;
+ toHighest = 0;
+ for (int[] range : toRange)
+ {
+ toLowest = Math.min(toLowest, range[0]);
+ toHighest = Math.max(toHighest, range[1]);
+ }
+ }
+
+ /**