|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Objectorg.apache.commons.lang.math.Range
org.apache.commons.lang.math.NumberRange
NumberRange represents an inclusive range of
Number objects of the same type.
| コンストラクタの概要 | |
NumberRange(Number num)
Constructs a new NumberRange using the specified
number as both the minimum and maximum in this range. |
|
NumberRange(Number num1,
Number num2)
Constructs a new NumberRange with the specified
minimum and maximum numbers (both inclusive). |
|
| メソッドの概要 | |
boolean |
containsNumber(Number number)
Tests whether the specified number occurs within
this range. |
boolean |
equals(Object obj)
Compares this range to another object to test if they are equal. |
Number |
getMaximumNumber()
Returns the maximum number in this range. |
Number |
getMinimumNumber()
Returns the minimum number in this range. |
int |
hashCode()
Gets a hashCode for the range. |
String |
toString()
Gets the range as a String. |
| クラス org.apache.commons.lang.math.Range から継承したメソッド |
containsDouble, containsDouble, containsFloat, containsFloat, containsInteger, containsInteger, containsLong, containsLong, containsRange, getMaximumDouble, getMaximumFloat, getMaximumInteger, getMaximumLong, getMinimumDouble, getMinimumFloat, getMinimumInteger, getMinimumLong, overlapsRange |
| クラス java.lang.Object から継承したメソッド |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| コンストラクタの詳細 |
public NumberRange(Number num)
Constructs a new NumberRange using the specified
number as both the minimum and maximum in this range.
num - the number to use for this range
IllegalArgumentException - if the number is null
IllegalArgumentException - if the number doesn't implement Comparable
IllegalArgumentException - if the number is Double.NaN or Float.NaN
public NumberRange(Number num1,
Number num2)
Constructs a new NumberRange with the specified
minimum and maximum numbers (both inclusive).
The arguments may be passed in the order (min,max) or (max,min). The
getMinimumNumber() and getMaximumNumber() methods will return the
correct value.
This constructor is designed to be used with two Number
objects of the same type. If two objects of different types are passed in,
an exception is thrown.
num1 - first number that defines the edge of the range, inclusivenum2 - second number that defines the edge of the range, inclusive
IllegalArgumentException - if either number is null
IllegalArgumentException - if the numbers are of different types
IllegalArgumentException - if the numbers don't implement Comparable| メソッドの詳細 |
public Number getMinimumNumber()
Returns the minimum number in this range.
Range 内の getMinimumNumberpublic Number getMaximumNumber()
Returns the maximum number in this range.
Range 内の getMaximumNumberpublic boolean containsNumber(Number number)
Tests whether the specified number occurs within
this range.
null is handled and returns false.
Range 内の containsNumbernumber - the number to test, may be null
true if the specified number occurs within this range
IllegalArgumentException - if the number is of a different type to the rangepublic boolean equals(Object obj)
Compares this range to another object to test if they are equal.
.To be equal, the class, minimum and maximum must be equal.
Range 内の equalsobj - the reference object with which to compare
true if this object is equalpublic int hashCode()
Gets a hashCode for the range.
Range 内の hashCodepublic String toString()
Gets the range as a String.
The format of the String is 'Range[min,max]'.
Range 内の toStringString representation of this range
|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||