- fromRange=new int[] { from[0],from[1] };
- toRange=new int[] { to[0],to[1] };
+ this.fromRatio = fromRatio;
+ this.toRatio = toRatio;
+ fromLowest = from[0];
+ fromHighest = from[1];
+ for (int i = 0; i < from.length; i += 2)
+ {
+ fromLowest = Math.min(fromLowest, from[i]);
+ fromHighest = Math.max(fromHighest, from[i + 1]);
+
+ fromShifts.add(new int[]
+ { from[i], from[i + 1] });
+ }
+
+ toLowest = to[0];
+ toHighest = to[1];
+ for (int i = 0; i < to.length; i += 2)
+ {
+ toLowest = Math.min(toLowest, to[i]);
+ toHighest = Math.max(toHighest, to[i + 1]);
+ toShifts.add(new int[]
+ { to[i], to[i + 1] });
+ }
+ }
+
+ /**
+ * Copy constructor. Creates an identical mapping.
+ *
+ * @param map
+ */
+ public MapList(MapList map)
+ {
+ // TODO not used - remove?
+ this.fromLowest = map.fromLowest;
+ this.fromHighest = map.fromHighest;
+ this.toLowest = map.toLowest;
+ this.toHighest = map.toHighest;