_empty = false;
}
+ /**
+ * Combine this range with another one
+ * @param inOtherRange other range to add to this one
+ */
+ public void combine(DoubleRange inOtherRange)
+ {
+ if (inOtherRange != null && inOtherRange.getRange() > 1.0)
+ {
+ addValue(inOtherRange.getMinimum());
+ addValue(inOtherRange.getMaximum());
+ }
+ }
/**
* @return true if data values were found
{
return _max - _min;
}
+
+ /**
+ * @return mid value, halfway between min and max
+ */
+ public double getMidValue()
+ {
+ return (_max + _min) / 2.0;
+ }
+
+ /**
+ * Copy this range into a new object, which can then be modified without changing this one
+ * @return deep copy of this object
+ */
+ public DoubleRange copy()
+ {
+ if (_empty) return new DoubleRange();
+ return new DoubleRange(_min, _max);
+ }
}