Class NumberRange
Represents a range of Number
objects.
This class uses double
comparisons. This means that it
is unsuitable for dealing with large Long
, BigDecimal
or BigInteger
numbers.
- Since:
- 1.0
- Version:
- $Revision: 1057072 $ $Date: 2011-01-10 01:55:57 +0000 (Mon, 10 Jan 2011) $
-
Constructor Summary
ConstructorsConstructorDescriptionNumberRange
(Number num) Deprecated.Constructs a newNumberRange
usingnumber
as both the minimum and maximum in this range.NumberRange
(Number min, Number max) Deprecated.Constructs a newNumberRange
with the specified minimum and maximum numbers. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.Indicates whether some otherObject
is "equal" to this one.Deprecated.Returns the maximum number in this range.Deprecated.Returns the minimum number in this range.int
hashCode()
Deprecated.Returns a hash code value for this object.boolean
includesNumber
(Number number) Deprecated.Tests whether the specifiednumber
occurs within this range usingdouble
comparison.boolean
includesRange
(NumberRange range) Deprecated.Tests whether the specified range occurs entirely within this range usingdouble
comparison.boolean
overlaps
(NumberRange range) Deprecated.Tests whether the specified range overlaps with this range usingdouble
comparison.toString()
Deprecated.Returns the string representation of this range.
-
Constructor Details
-
NumberRange
Deprecated.Constructs a new
NumberRange
usingnumber
as both the minimum and maximum in this range.- Parameters:
num
- the number to use for this range- Throws:
NullPointerException
- if the number isnull
-
NumberRange
Deprecated.Constructs a new
NumberRange
with the specified minimum and maximum numbers.If the maximum is less than the minimum, the range will be constructed from the minimum value to the minimum value, not what you would expect!.
- Parameters:
min
- the minimum number in this rangemax
- the maximum number in this range- Throws:
NullPointerException
- if either the minimum or maximum number isnull
-
-
Method Details
-
getMinimum
Deprecated.Returns the minimum number in this range.
- Returns:
- the minimum number in this range
-
getMaximum
Deprecated.Returns the maximum number in this range.
- Returns:
- the maximum number in this range
-
includesNumber
Deprecated.Tests whether the specified
number
occurs within this range usingdouble
comparison.- Parameters:
number
- the number to test- Returns:
true
if the specified number occurs within this range; otherwise,false
-
includesRange
Deprecated.Tests whether the specified range occurs entirely within this range using
double
comparison.- Parameters:
range
- the range to test- Returns:
true
if the specified range occurs entirely within this range; otherwise,false
-
overlaps
Deprecated.Tests whether the specified range overlaps with this range using
double
comparison.- Parameters:
range
- the range to test- Returns:
true
if the specified range overlaps with this range; otherwise,false
-
equals
Deprecated.Indicates whether some other
Object
is "equal" to this one. -
hashCode
public int hashCode()Deprecated.Returns a hash code value for this object.
-
toString
Deprecated.Returns the string representation of this range.
This string is the string representation of the minimum and maximum numbers in the range, separated by a hyphen. If a number is negative, then it is enclosed in parentheses.
-