public class GInterval extends GIntervalAbstract implements Cloneable
if (okMinValue <= value <= okMaxValue) then OK else if (warnMinValue <= value <= warnMaxValue) then WARN else ERROR end ifThe interval limits can be, independently, inclusive or exclusive, so the comparisons are "<=" and "=>" or just "<" and ">".
GIntervalAbstract.GStatus, GIntervalAbstract.Rule
Constructor and Description |
---|
GInterval(Number okMin,
Number okMax)
Constructor of the interval only with OK zone and inclusive rules in both edges.
|
GInterval(Number okMin,
Number okMax,
GIntervalAbstract.Rule okMinRule,
GIntervalAbstract.Rule okMaxRule)
Constructor of the interval only with OK zone.
|
GInterval(Number okMin,
Number okMax,
GIntervalAbstract.Rule okMinRule,
GIntervalAbstract.Rule okMaxRule,
Number warnMin,
Number warnMax,
GIntervalAbstract.Rule warnMinRule,
GIntervalAbstract.Rule warnMaxRule)
Constructor of the interval with OK and WARN zones.
|
Modifier and Type | Method and Description |
---|---|
void |
checkInterval()
Checks the coherence of the Ok and Warn values and rules.
|
GInterval |
clone() |
GIntervalAbstract.Rule |
getMaxRule()
Get the rule applying to the absolute maximum.
|
Double |
getMaxValue()
Get the absolute maximum value of the ok maximum and warning maximum.
|
String |
getMessage()
Get the message describing the interval checks.
|
GIntervalAbstract.Rule |
getMinRule()
Get the rule applying to the absolute minimum.
|
Double |
getMinValue()
Get the absolute minimum value of the ok minimum and warning minimum.
|
double |
getOkMax() |
GIntervalAbstract.Rule |
getOkMaxRule() |
double |
getOkMin() |
GIntervalAbstract.Rule |
getOkMinRule() |
double |
getWarnMax() |
GIntervalAbstract.Rule |
getWarnMaxRule() |
double |
getWarnMin() |
GIntervalAbstract.Rule |
getWarnMinRule() |
boolean |
isWarnCheckEnabled() |
boolean |
overlaps(GIntervalAbstract otherInterval)
Check the overlapping with another interval.
|
void |
removeWarnCheck()
Removes the WARN zone of the interval.
|
void |
removeWarnCheck(boolean isCheck)
Removes the WARN zone of the interval.
|
void |
setOkMax(double okMax)
Set the absolute maximum value of the OK zone.
|
void |
setOkMax(double okMax,
boolean isCheck)
Set the absolute maximum value of the OK zone.
|
void |
setOkMaxRule(GIntervalAbstract.Rule okMaxRule)
Set the rule applying to the absolute maximum of the OK zone.
|
void |
setOkMaxRule(GIntervalAbstract.Rule okMaxRule,
boolean isCheck)
Set the rule applying to the absolute maximum of the OK zone.
|
void |
setOkMin(double okMin)
Set the absolute minimum value of the OK zone.
|
void |
setOkMin(double okMin,
boolean isCheck)
Set the absolute minimum value of the OK zone.
|
void |
setOkMinRule(GIntervalAbstract.Rule okMinRule)
Set the rule applying to the absolute minimum of the OK zone.
|
void |
setOkMinRule(GIntervalAbstract.Rule okMinRule,
boolean isCheck)
Set the rule applying to the absolute minimum of the OK zone.
|
void |
setWarnMax(double warnMax)
Set the absolute maximum value of the WARN zone.
|
void |
setWarnMax(double warnMax,
boolean isCheck)
Set the absolute maximum value of the WARN zone.
|
void |
setWarnMaxRule(GIntervalAbstract.Rule warnMaxRule)
Set the rule applying to the absolute maximum of the WARN zone.
|
void |
setWarnMaxRule(GIntervalAbstract.Rule warnMaxRule,
boolean isCheck)
Set the rule applying to the absolute maximum of the WARN zone.
|
void |
setWarnMin(double warnMin)
Set the absolute minimum value of the WARN zone.
|
void |
setWarnMin(double warnMin,
boolean isCheck)
Set the absolute minimum value of the WARN zone.
|
void |
setWarnMinRule(GIntervalAbstract.Rule warnMinRule)
Set the rule applying to the absolute minimum of the WARN zone.
|
void |
setWarnMinRule(GIntervalAbstract.Rule warnMinRule,
boolean isCheck)
Set the rule applying to the absolute minimum of the WARN zone.
|
GIntervalAbstract.GStatus |
testRange(Object object)
Check the value against the interval.
|
void |
updateMessage(GUnit currentUnit,
GIntervalFormatAbstract formatter)
Update the interval message using the unit, and format provided.
|
public GInterval(Number okMin, Number okMax, GIntervalAbstract.Rule okMinRule, GIntervalAbstract.Rule okMaxRule)
okMin
- minimum value of the OK range.okMax
- maximum value of the OK range.okMinRule
- rule used for the comparison against the minimum value of the OK range.okMaxRule
- rule used for the comparison against the maximum value of the OK range.public GInterval(Number okMin, Number okMax)
okMin
- minimum value of the OK range.okMax
- maximum value of the OK range.public GInterval(Number okMin, Number okMax, GIntervalAbstract.Rule okMinRule, GIntervalAbstract.Rule okMaxRule, Number warnMin, Number warnMax, GIntervalAbstract.Rule warnMinRule, GIntervalAbstract.Rule warnMaxRule)
okMin
- minimum value of the OK range.okMax
- maximum value of the OK range.okMinRule
- rule used for the comparison against the minimum value of the OK range.okMaxRule
- rule used for the comparison against the maximum value of the OK range.warnMin
- minimum value of the WARN range.warnMax
- maximum value of the WARN range.warnMinRule
- rule used for the comparison against the minimum value of the WARN range.warnMaxRule
- rule used for the comparison against the maximum value of the WARN range.public final void checkInterval() throws GIntervalException
GIntervalException
- if:public String getMessage()
getMessage
in class GIntervalAbstract
public GIntervalAbstract.GStatus testRange(Object object)
testRange
in class GIntervalAbstract
object
- value to check.public boolean overlaps(GIntervalAbstract otherInterval)
overlaps
in class GIntervalAbstract
otherInterval
- to verify the overlapping.public Double getMinValue()
GIntervalAbstract
getMinValue
in class GIntervalAbstract
public Double getMaxValue()
GIntervalAbstract
getMaxValue
in class GIntervalAbstract
public GIntervalAbstract.Rule getMinRule()
GIntervalAbstract
getMinRule
in class GIntervalAbstract
public GIntervalAbstract.Rule getMaxRule()
GIntervalAbstract
getMaxRule
in class GIntervalAbstract
public double getOkMin()
public double getOkMax()
public GIntervalAbstract.Rule getOkMinRule()
public GIntervalAbstract.Rule getOkMaxRule()
public boolean isWarnCheckEnabled()
public double getWarnMin()
public double getWarnMax()
public GIntervalAbstract.Rule getWarnMinRule()
public GIntervalAbstract.Rule getWarnMaxRule()
public void setOkMin(double okMin) throws GIntervalException
okMin
- the absolute minimum value of the OK zone.GIntervalException
- if the interval is not validpublic void setOkMin(double okMin, boolean isCheck) throws GIntervalException
okMin
- the absolute minimum value of the OK zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void setOkMax(double okMax) throws GIntervalException
okMax
- the absolute maximum value of the OK zone.GIntervalException
- if the interval is not validpublic void setOkMax(double okMax, boolean isCheck) throws GIntervalException
okMax
- the absolute maximum value of the OK zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void setOkMinRule(GIntervalAbstract.Rule okMinRule) throws GIntervalException
okMinRule
- the rule applying to the absolute minimum of the OK zone.GIntervalException
- if the interval is not validpublic void setOkMinRule(GIntervalAbstract.Rule okMinRule, boolean isCheck) throws GIntervalException
okMinRule
- the rule applying to the absolute minimum of the OK zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void setOkMaxRule(GIntervalAbstract.Rule okMaxRule) throws GIntervalException
okMaxRule
- the rule applying to the absolute maximum of the OK zone.GIntervalException
- if the interval is not validpublic void setOkMaxRule(GIntervalAbstract.Rule okMaxRule, boolean isCheck) throws GIntervalException
okMaxRule
- the rule applying to the absolute maximum of the OK zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void setWarnMin(double warnMin) throws GIntervalException
warnMin
- the absolute minimum value of the WARN zone.GIntervalException
- if the interval is not validpublic void setWarnMin(double warnMin, boolean isCheck) throws GIntervalException
warnMin
- the absolute minimum value of the WARN zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void setWarnMax(double warnMax) throws GIntervalException
warnMax
- the absolute maximum value of the WARN zone.GIntervalException
- if the interval is not validpublic void setWarnMax(double warnMax, boolean isCheck) throws GIntervalException
warnMax
- the absolute maximum value of the WARN zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void setWarnMinRule(GIntervalAbstract.Rule warnMinRule) throws GIntervalException
warnMinRule
- the rule applying to the absolute minimum of the WARN zone.GIntervalException
- if the interval is not validpublic void setWarnMinRule(GIntervalAbstract.Rule warnMinRule, boolean isCheck) throws GIntervalException
warnMinRule
- the rule applying to the absolute minimum of the WARN zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void setWarnMaxRule(GIntervalAbstract.Rule warnMaxRule) throws GIntervalException
warnMaxRule
- the rule applying to the absolute maximum of the WARN zone.GIntervalException
- if the interval is not validpublic void setWarnMaxRule(GIntervalAbstract.Rule warnMaxRule, boolean isCheck) throws GIntervalException
warnMaxRule
- the rule applying to the absolute maximum of the WARN zone.isCheck
- check if true.GIntervalException
- if the interval is not validpublic void removeWarnCheck() throws GIntervalException
GIntervalException
- if the interval is not validpublic void removeWarnCheck(boolean isCheck) throws GIntervalException
isCheck
- check if true.GIntervalException
- if the interval is not validpublic void updateMessage(GUnit currentUnit, GIntervalFormatAbstract formatter)
updateMessage
in class GIntervalAbstract
currentUnit
- the unit to use to convert the interval limits.formatter
- Necessary data to format the message (normal/scientific format and fractional digits)Copyright © 2024. All rights reserved.