return new MapList(getToRanges(), getFromRanges(), getToRatio(),
getFromRatio());
}
+
+ /**
+ * test for containment rather than equivalence to another mapping
+ * @param map to be tested for containment
+ * @return true if local or mapped range map contains or is contained by this mapping
+ */
+ public boolean containsEither(boolean local, MapList map)
+ {
+ if (local)
+ {
+ return ((getFromLowest()>=map.getFromLowest() && getFromHighest()<=map.getFromHighest())
+ || (getFromLowest()<=map.getFromLowest() && getFromHighest()>=map.getFromHighest()));
+ } else {
+ return ((getToLowest()>=map.getToLowest() && getToHighest()<=map.getToHighest())
+ || (getToLowest()<=map.getToLowest() && getToHighest()>=map.getToHighest()));
+ }
+ }
}