org.apache.commons.lang
クラス NumberRange

java.lang.Object
  拡張org.apache.commons.lang.NumberRange

推奨されていません。 org.apache.commons.lang.math の中の 該当する Range クラスを使用してください。 このクラスは Commons Lang 3.0 では削除されます。
Use one of the Range classes in org.apache.commons.lang.math. Class will be removed in Commons Lang 3.0.

public final class NumberRange
extends Object

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.

導入されたバージョン:
1.0
バージョン:
$Revision: 1.1.1.1 $ $Date: 2004/02/13 10:02:05 $
作成者:
Christopher Elkins, Stephen Colebourne
翻訳状況:
見送り

コンストラクタの概要
NumberRange(Number num)
          推奨されていません。 Constructs a new NumberRange using number as both the minimum and maximum in this range.
NumberRange(Number min, Number max)
          推奨されていません。 Constructs a new NumberRange with the specified minimum and maximum numbers.
 
メソッドの概要
 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 using double comparison.
 boolean includesRange(NumberRange range)
          推奨されていません。 Tests whether the specified range occurs entirely within this range using double comparison.
 boolean overlaps(NumberRange range)
          推奨されていません。 Tests whether the specified range overlaps with this range using double comparison.
 String toString()
          推奨されていません。 Returns the string representation of this range.
 
クラス java.lang.Object から継承したメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

NumberRange

public NumberRange(Number num)
推奨されていません。 

Constructs a new NumberRange using number as both the minimum and maximum in this range.

パラメータ:
num - the number to use for this range
例外:
NullPointerException - if the number is null

NumberRange

public NumberRange(Number min,
                   Number max)
推奨されていません。 

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!.

パラメータ:
min - the minimum number in this range
max - the maximum number in this range
例外:
NullPointerException - if either the minimum or maximum number is null
メソッドの詳細

getMinimum

public Number getMinimum()
推奨されていません。 

Returns the minimum number in this range.

戻り値:
the minimum number in this range

getMaximum

public Number getMaximum()
推奨されていません。 

Returns the maximum number in this range.

戻り値:
the maximum number in this range

includesNumber

public boolean includesNumber(Number number)
推奨されていません。 

Tests whether the specified number occurs within this range using double comparison.

パラメータ:
number - the number to test
戻り値:
true if the specified number occurs within this range; otherwise, false

includesRange

public boolean includesRange(NumberRange range)
推奨されていません。 

Tests whether the specified range occurs entirely within this range using double comparison.

パラメータ:
range - the range to test
戻り値:
true if the specified range occurs entirely within this range; otherwise, false

overlaps

public boolean overlaps(NumberRange range)
推奨されていません。 

Tests whether the specified range overlaps with this range using double comparison.

パラメータ:
range - the range to test
戻り値:
true if the specified range overlaps with this range; otherwise, false

equals

public boolean equals(Object obj)
推奨されていません。 

Indicates whether some other Object is "equal" to this one.

パラメータ:
obj - the reference object with which to compare
戻り値:
true if this object is the same as the obj argument; false otherwise

hashCode

public int hashCode()
推奨されていません。 

Returns a hash code value for this object.

戻り値:
a hash code value for this object

toString

public String toString()
推奨されていません。 

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.

戻り値:
the string representation of this range


このドキュメントは、Ja-Jakartaにより訳されました。 コメントがある場合は report@jajakarta.orgまでお願いします。
Translated into Japanese by jajakarta.org. The original page is here.
Copyright (c) 2002-2003 - Apache Software Foundation