Package org.openl.rules.helpers
Class DoubleRange
- java.lang.Object
-
- org.openl.rules.range.Range<Double>
-
- org.openl.rules.helpers.DoubleRange
-
- All Implemented Interfaces:
INumberRange
public class DoubleRange extends Range<Double> implements INumberRange
TheDoubleRangeclass stores range of floats. Examples : "1.2-3", "2 .. 4", "123.456 ... 1000.00001" (Important: using of ".." and "..." requires spaces between numbers and separator).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openl.rules.range.Range
Range.Bound, Range.Type
-
-
Constructor Summary
Constructors Constructor Description DoubleRange()DoubleRange(double range)DoubleRange(double lowerBound, double upperBound)DoubleRange(double lowerBound, double upperBound, ARangeParser.ParseStruct.BoundType lowerBoundType, ARangeParser.ParseStruct.BoundType upperBoundType)DoubleRange(String range)
-
Method Summary
-
-
-
Constructor Detail
-
DoubleRange
public DoubleRange(double range)
-
DoubleRange
public DoubleRange(double lowerBound, double upperBound)
-
DoubleRange
public DoubleRange(double lowerBound, double upperBound, ARangeParser.ParseStruct.BoundType lowerBoundType, ARangeParser.ParseStruct.BoundType upperBoundType)
-
DoubleRange
public DoubleRange()
-
DoubleRange
public DoubleRange(String range)
-
-
Method Detail
-
isTruncated
protected static boolean isTruncated(Number from, double to)
Returns true if converted value is truncated- Parameters:
from- converting numberto- converted double value- Returns:
- true if converted value is truncated
-
compareLowerBound
@Deprecated public int compareLowerBound(DoubleRange range)
Deprecated.Compares lower bounds.- Parameters:
range- the DoubleRange to be compared- Returns:
- a negative integer, zero, or a positive integer as lower bound of this range is less than, equal to, or greater than the lower bound of specified range.
-
compareUpperBound
@Deprecated public int compareUpperBound(DoubleRange range)
Deprecated.Compares upper bounds.- Parameters:
range- the DoubleRange to be compared- Returns:
- a negative integer, zero, or a positive integer as upper bound of this range is less than, equal to, or greater than the upper bound of specified range.
-
contains
public boolean contains(Number n)
- Specified by:
containsin interfaceINumberRange
-
getType
public Range.Type getType()
-
getLowerBound
public double getLowerBound()
- Returns:
- Returns the lowerBound.
-
getUpperBound
public double getUpperBound()
- Returns:
- Returns the upperBound.
-
intersect
@Deprecated public DoubleRange intersect(DoubleRange range)
Deprecated.
-
setLowerBound
@Deprecated public void setLowerBound(double lowerBound)
Deprecated.- Parameters:
lowerBound- The lowerBound to set.
-
setUpperBound
@Deprecated public void setUpperBound(double upperBound)
Deprecated.- Parameters:
upperBound- The upperBound to set.
-
getLowerBoundType
@Deprecated public ARangeParser.ParseStruct.BoundType getLowerBoundType()
Deprecated.
-
setLowerBoundType
@Deprecated public void setLowerBoundType(ARangeParser.ParseStruct.BoundType lowerBoundType)
Deprecated.
-
getUpperBoundType
@Deprecated public ARangeParser.ParseStruct.BoundType getUpperBoundType()
Deprecated.
-
setUpperBoundType
@Deprecated public void setUpperBoundType(ARangeParser.ParseStruct.BoundType upperBoundType)
Deprecated.
-
autocast
public static DoubleRange autocast(byte x, DoubleRange y)
-
distance
public static int distance(byte x, DoubleRange y)
-
autocast
public static DoubleRange autocast(short x, DoubleRange y)
-
distance
public static int distance(short x, DoubleRange y)
-
autocast
public static DoubleRange autocast(int x, DoubleRange y)
-
distance
public static int distance(int x, DoubleRange y)
-
autocast
public static DoubleRange autocast(long x, DoubleRange y)
-
distance
public static int distance(long x, DoubleRange y)
-
autocast
public static DoubleRange autocast(float x, DoubleRange y)
-
distance
public static int distance(float x, DoubleRange y)
-
autocast
public static DoubleRange autocast(double x, DoubleRange y)
-
distance
public static int distance(double x, DoubleRange y)
-
cast
public static DoubleRange cast(BigInteger x, DoubleRange y)
-
distance
public static int distance(BigInteger x, DoubleRange y)
-
cast
public static DoubleRange cast(BigDecimal x, DoubleRange y)
-
distance
public static int distance(BigDecimal x, DoubleRange y)
-
autocast
public static DoubleRange autocast(IntRange x, DoubleRange y)
-
-