类 FloatRange
java.lang.Object
org.openurp.base.util.FloatRange
- 所有已实现的接口:
org.beangle.commons.entity.Component
区间,默认两端都是闭区间
-
构造器概要
构造器构造器说明Constructs a newFloatRange, which is [0, 0].FloatRange(float number) Constructs a newFloatRange, which is [number, number].FloatRange(float min, boolean minInclusive, float max, boolean maxInclusive) FloatRange(float min, float max) Constructs a newFloatRangewith the specified minimum and maximum numbers (both inclusive). -
方法概要
修饰符和类型方法说明booleancontainsFloat(float value) booleancontainsRange(FloatRange range) booleanvoidfloatfloatgetMax()floatgetMin()inthashCode()voidbooleanbooleanvoidvoidvoidvoidbooleanoverlapsRange(FloatRange range) voidsetMax(float max) voidsetMaxInclusive(boolean maxInclusive) voidsetMin(float min) voidsetMinInclusive(boolean minInclusive) toString()
-
构造器详细资料
-
FloatRange
public FloatRange()Constructs a new
FloatRange, which is [0, 0]. -
FloatRange
public FloatRange(float number) Constructs a new
FloatRange, which is [number, number].- 参数:
number- the number to use for this range- 抛出:
IllegalArgumentException- if the number isNaN
-
FloatRange
public FloatRange(float min, float max) Constructs a new
FloatRangewith the specified minimum and maximum numbers (both inclusive).The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.
- 参数:
min- first number that defines the edge of the range, inclusivemax- second number that defines the edge of the range, inclusive- 抛出:
IllegalArgumentException- if either number isNaN
-
FloatRange
public FloatRange(float min, boolean minInclusive, float max, boolean maxInclusive)
-
-
方法详细资料
-
minInclusive
public void minInclusive() -
minExclusive
public void minExclusive() -
inclusive
public void inclusive() -
exclusive
public void exclusive() -
maxInclusive
public void maxInclusive() -
maxExclusive
public void maxExclusive() -
getMin
public float getMin() -
setMin
public void setMin(float min) -
isMinInclusive
public boolean isMinInclusive() -
setMinInclusive
public void setMinInclusive(boolean minInclusive) -
getMax
public float getMax() -
setMax
public void setMax(float max) -
isMaxInclusive
public boolean isMaxInclusive() -
setMaxInclusive
public void setMaxInclusive(boolean maxInclusive) -
containsFloat
public boolean containsFloat(float value) -
containsRange
-
overlapsRange
-
getDistance
public float getDistance() -
hashCode
public int hashCode() -
equals
-
toString
-