/** * <p>Tests whether the specified <code>double</code> occurs within * this range using <code>double</code> comparison.</p> * * <p>This implementation uses the {@link #getMinimumDouble()} and * {@link #getMaximumDouble()} methods and should be good for most uses.</p> * * @param value the double to test * @return <code>true</code> if the specified number occurs within this * range by <code>double</code> comparison */ public boolean containsDouble(double value) { int compareMin = NumberUtils.compare(getMinimumDouble(), value); int compareMax = NumberUtils.compare(getMaximumDouble(), value); return compareMin <= 0 && compareMax >= 0; }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>double</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsDouble(range.getMinimumDouble()) && containsDouble(range.getMaximumDouble()); }
/** * <p>Tests whether the specified <code>double</code> occurs within * this range using <code>double</code> comparison.</p> * * <p>This implementation uses the {@link #getMinimumDouble()} and * {@link #getMaximumDouble()} methods and should be good for most uses.</p> * * @param value the double to test * @return <code>true</code> if the specified number occurs within this * range by <code>double</code> comparison */ public boolean containsDouble(double value) { int compareMin = NumberUtils.compare(getMinimumDouble(), value); int compareMax = NumberUtils.compare(getMaximumDouble(), value); return compareMin <= 0 && compareMax >= 0; }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>double</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsDouble(range.getMinimumDouble()) && containsDouble(range.getMaximumDouble()); }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>double</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsDouble(range.getMinimumDouble()) && containsDouble(range.getMaximumDouble()); }
/** * <p>Tests whether the specified <code>double</code> occurs within * this range using <code>double</code> comparison.</p> * * <p>This implementation uses the {@link #getMinimumDouble()} and * {@link #getMaximumDouble()} methods and should be good for most uses.</p> * * @param value the double to test * @return <code>true</code> if the specified number occurs within this * range by <code>double</code> comparison */ public boolean containsDouble(double value) { int compareMin = NumberUtils.compare(getMinimumDouble(), value); int compareMax = NumberUtils.compare(getMaximumDouble(), value); return compareMin <= 0 && compareMax >= 0; }
/** * <p>Tests whether the specified <code>double</code> occurs within * this range using <code>double</code> comparison.</p> * * <p>This implementation uses the {@link #getMinimumDouble()} and * {@link #getMaximumDouble()} methods and should be good for most uses.</p> * * @param value the double to test * @return <code>true</code> if the specified number occurs within this * range by <code>double</code> comparison */ public boolean containsDouble(double value) { int compareMin = NumberUtils.compare(getMinimumDouble(), value); int compareMax = NumberUtils.compare(getMaximumDouble(), value); return compareMin <= 0 && compareMax >= 0; }
/** * <p>Tests whether the specified <code>double</code> occurs within * this range using <code>double</code> comparison.</p> * * <p>This implementation uses the {@link #getMinimumDouble()} and * {@link #getMaximumDouble()} methods and should be good for most uses.</p> * * @param value the double to test * @return <code>true</code> if the specified number occurs within this * range by <code>double</code> comparison */ public boolean containsDouble(double value) { int compareMin = NumberUtils.compare(getMinimumDouble(), value); int compareMax = NumberUtils.compare(getMaximumDouble(), value); return compareMin <= 0 && compareMax >= 0; }
/** * <p>Tests whether the specified <code>double</code> occurs within * this range using <code>double</code> comparison.</p> * * <p>This implementation uses the {@link #getMinimumDouble()} and * {@link #getMaximumDouble()} methods and should be good for most uses.</p> * * @param value the double to test * @return <code>true</code> if the specified number occurs within this * range by <code>double</code> comparison */ public boolean containsDouble(double value) { int compareMin = NumberUtils.compare(getMinimumDouble(), value); int compareMax = NumberUtils.compare(getMaximumDouble(), value); return compareMin <= 0 && compareMax >= 0; }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>double</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsDouble(range.getMinimumDouble()) && containsDouble(range.getMaximumDouble()); }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>double</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsDouble(range.getMinimumDouble()) && containsDouble(range.getMaximumDouble()); }
/** * <p>Tests whether the specified range occurs entirely within this range * using <code>double</code> comparison.</p> * * <p><code>null</code> is handled and returns <code>false</code>.</p> * * @param range the range to test, may be <code>null</code> * @return <code>true</code> if the specified range occurs entirely within this range * @throws IllegalArgumentException if the range is not of this type */ public boolean containsRange(Range range) { if (range == null) { return false; } return containsDouble(range.getMinimumDouble()) && containsDouble(range.getMaximumDouble()); }