|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.lang.NumberRange
Represents a range of Number
objects.
Field Summary | |
private Number |
max
|
private Number |
min
|
Constructor Summary | |
NumberRange(Number num)
Constructs a new instance using the specified number as both the minimum and maximum in theis range. |
|
NumberRange(Number min,
Number max)
Constructs a new instance with the specified minimum and maximum numbers. |
Method Summary | |
boolean |
equals(Object obj)
Indicates whether some other object is "equal" to this one. |
Number |
getMaximum()
Returns the maximum number in this range. |
Number |
getMinimum()
Returns the minimum number in this range. |
int |
hashCode()
Returns a hash code value for this object. |
boolean |
includesNumber(Number number)
Tests whether the specified number occurs within this range. |
boolean |
includesRange(NumberRange range)
Tests whether the specified range occurs entirely within this range. |
boolean |
overlaps(NumberRange range)
Tests whether the specified range overlaps with this range. |
String |
toString()
Returns the string representation of this range. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private final Number min
private final Number max
Constructor Detail |
public NumberRange(Number num)
num
- the number to use for this range
NullPointerException
- if the number is null
public NumberRange(Number min, Number max)
min
- the minimum number in this rangemax
- the maximum number in this range
NullPointerException
- if either the minimum or maximum number is
null
Method Detail |
public Number getMinimum()
public Number getMaximum()
public boolean includesNumber(Number number)
number
- the number to test
true
if the specified number occurs within this
range; otherwise, false
public boolean includesRange(NumberRange range)
range
- the range to test
true
if the specified range occurs entirely within
this range; otherwise, false
public boolean overlaps(NumberRange range)
range
- the range to test
true
if the specified range overlaps with this
range; otherwise, false
public boolean equals(Object obj)
equals
in class Object
obj
- the reference object with which to compare
true
if this object is the same as the obj
argument; false
otherwisepublic int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |