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