java.lang.Object
org.yamcs.xtce.util.DoubleRange
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FloatValidRange
A range of numbers [min, max) where both min and max can be inclusive or exclusive.
Both min and max can be Double.NaN meaning that the range is open at that end.
- See Also:
-
Constructor Summary
ConstructorDescriptionDoubleRange
(double minInclusive, double maxInclusive) DoubleRange
(double min, double max, boolean minIncl, boolean maxIncl) DoubleRange
(DoubleRange range) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static DoubleRange
fromXtceComplement
(double minExclusive, double maxExclusive, double minInclusive, double maxInclusive) Returns a range from the XTCE float range used for alarms which is in fact a union of two rangesdouble
getMax()
double
getMin()
int
hashCode()
int
inRange
(double v) Checks if the value is in range.intersectWith
(DoubleRange other) E.g. a low limit of ]-Infinity, -22] and a high limit of [40, +Infinity[ intersect to [-22, 40] (which for practical purposes is actually the range inside of which pvals are _not_ out of limits)boolean
boolean
toString()
-
Constructor Details
-
DoubleRange
public DoubleRange(double min, double max, boolean minIncl, boolean maxIncl) -
DoubleRange
public DoubleRange(double minInclusive, double maxInclusive) -
DoubleRange
-
-
Method Details
-
fromXtceComplement
public static DoubleRange fromXtceComplement(double minExclusive, double maxExclusive, double minInclusive, double maxInclusive) Returns a range from the XTCE float range used for alarms which is in fact a union of two ranges- Parameters:
minExclusive
-maxExclusive
-minInclusive
-maxInclusive
-- Returns:
-
getMax
public double getMax() -
getMin
public double getMin() -
isMinInclusive
public boolean isMinInclusive() -
isMaxInclusive
public boolean isMaxInclusive() -
inRange
public int inRange(double v) Checks if the value is in range.- Parameters:
v
-- Returns:
- <0 =0 or >0 if the value v is lower than min, between min and max or greater than max respectively.
-
intersectWith
E.g. a low limit of ]-Infinity, -22] and a high limit of [40, +Infinity[ intersect to [-22, 40] (which for practical purposes is actually the range inside of which pvals are _not_ out of limits) -
toString
-
hashCode
public int hashCode() -
equals
-