public class GIntervalDate 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 |
---|
GIntervalDate(Date okMin,
Date okMax)
Constructor of the interval only with OK zone and inclusive rules in both edges.
|
GIntervalDate(Date okMin,
Date okMax,
GIntervalAbstract.Rule okMinRule,
GIntervalAbstract.Rule okMaxRule)
Constructor of the interval only with OK zone.
|
GIntervalDate(Date okMin,
Date okMax,
GIntervalAbstract.Rule okMinRule,
GIntervalAbstract.Rule okMaxRule,
Date warnMin,
Date warnMax,
GIntervalAbstract.Rule warnMinRule,
GIntervalAbstract.Rule warnMaxRule)
Constructor of the interval with OK and WARN zones.
|
GIntervalDate(String okMin,
String okMax)
Constructor of the interval only with OK zone and inclusive rules in both edges.
|
GIntervalDate(String okMin,
String okMax,
GIntervalAbstract.Rule okMinRule,
GIntervalAbstract.Rule okMaxRule)
Constructor of the interval only with OK zone.
|
GIntervalDate(String okMin,
String okMax,
GIntervalAbstract.Rule okMinRule,
GIntervalAbstract.Rule okMaxRule,
String warnMin,
String warnMax,
GIntervalAbstract.Rule warnMinRule,
GIntervalAbstract.Rule warnMaxRule)
Constructor of the interval with OK and WARN zones.
|
Modifier and Type | Method and Description |
---|---|
protected GIntervalDate |
clone() |
protected GIntervalAbstract.Rule |
getMaxRule()
Get the rule applying to the absolute maximum.
|
protected Date |
getMaxValue()
Get the absolute maximum value of the ok maximum and warning maximum.
|
String |
getMessage()
Get the message describing the interval checks.
|
protected GIntervalAbstract.Rule |
getMinRule()
Get the rule applying to the absolute minimum.
|
protected Date |
getMinValue()
Get the absolute minimum value of the ok minimum and warning minimum.
|
protected Date |
getOkMax() |
protected GIntervalAbstract.Rule |
getOkMaxRule() |
protected Date |
getOkMin() |
protected GIntervalAbstract.Rule |
getOkMinRule() |
protected Date |
getWarnMax() |
protected GIntervalAbstract.Rule |
getWarnMaxRule() |
protected Date |
getWarnMin() |
protected GIntervalAbstract.Rule |
getWarnMinRule() |
protected boolean |
isWarnCheckEnabled() |
boolean |
overlaps(GIntervalAbstract otherInterval)
Check the overlapping with another interval.
|
protected void |
removeWarnCheck()
Removes the WARN zone of the interval.
|
protected void |
setOkMax(Date okMax)
Set the absolute maximum value of the OK zone.
|
protected void |
setOkMax(String okMax)
Set the absolute maximum value of the OK zone.
|
protected void |
setOkMaxRule(GIntervalAbstract.Rule okMaxRule)
Set the rule applying to the absolute maximum of the OK zone.
|
protected void |
setOkMin(Date okMin)
Set the absolute minimum value of the OK zone.
|
protected void |
setOkMin(String okMin)
Set the absolute minimum value of the OK zone.
|
protected void |
setOkMinRule(GIntervalAbstract.Rule okMinRule)
Set the rule applying to the absolute minimum of the OK zone.
|
protected void |
setWarnMax(Date warnMax)
Set the absolute maximum value of the WARN zone.
|
protected void |
setWarnMax(String warnMax)
Set the absolute maximum value of the WARN zone.
|
protected void |
setWarnMaxRule(GIntervalAbstract.Rule warnMaxRule)
Set the rule applying to the absolute maximum of the WARN zone.
|
protected void |
setWarnMin(Date warnMin)
Set the absolute minimum value of the WARN zone.
|
protected void |
setWarnMin(String warnMin)
Set the absolute minimum value of the WARN zone.
|
protected void |
setWarnMinRule(GIntervalAbstract.Rule warnMinRule)
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 GIntervalDate(Date okMin, Date 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 GIntervalDate(String okMin, String okMax, GIntervalAbstract.Rule okMinRule, GIntervalAbstract.Rule okMaxRule) throws GDateFieldException
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.GDateFieldException
- in case of error parsing the date strings.public GIntervalDate(Date okMin, Date okMax)
okMin
- minimum value of the OK range.okMax
- maximum value of the OK range.public GIntervalDate(String okMin, String okMax) throws GDateFieldException
okMin
- minimum value of the OK range.okMax
- maximum value of the OK range.GDateFieldException
- in case of error parsing the date strings.public GIntervalDate(String okMin, String okMax, GIntervalAbstract.Rule okMinRule, GIntervalAbstract.Rule okMaxRule, String warnMin, String warnMax, GIntervalAbstract.Rule warnMinRule, GIntervalAbstract.Rule warnMaxRule) throws GDateFieldException
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.GDateFieldException
- in case of error parsing the date strings.public GIntervalDate(Date okMin, Date okMax, GIntervalAbstract.Rule okMinRule, GIntervalAbstract.Rule okMaxRule, Date warnMin, Date 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 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.protected Date getMinValue()
GIntervalAbstract
getMinValue
in class GIntervalAbstract
protected Date getMaxValue()
GIntervalAbstract
getMaxValue
in class GIntervalAbstract
protected GIntervalAbstract.Rule getMinRule()
GIntervalAbstract
getMinRule
in class GIntervalAbstract
protected GIntervalAbstract.Rule getMaxRule()
GIntervalAbstract
getMaxRule
in class GIntervalAbstract
protected Date getOkMin()
protected Date getOkMax()
protected GIntervalAbstract.Rule getOkMinRule()
protected GIntervalAbstract.Rule getOkMaxRule()
protected boolean isWarnCheckEnabled()
protected Date getWarnMin()
protected Date getWarnMax()
protected GIntervalAbstract.Rule getWarnMinRule()
protected GIntervalAbstract.Rule getWarnMaxRule()
protected void setOkMin(Date okMin)
okMin
- the absolute minimum value of the OK zone.protected void setOkMin(String okMin) throws GDateFieldException
okMin
- the absolute minimum value of the OK zone.GDateFieldException
- in case the date can not be parsed.protected void setOkMax(Date okMax)
okMax
- the absolute maximum value of the OK zone.protected void setOkMax(String okMax) throws GDateFieldException
okMax
- the absolute maximum value of the OK zone.GDateFieldException
- in case the date can not be parsed.protected void setOkMinRule(GIntervalAbstract.Rule okMinRule)
okMinRule
- the rule applying to the absolute minimum of the OK zone.protected void setOkMaxRule(GIntervalAbstract.Rule okMaxRule)
okMaxRule
- the rule applying to the absolute maximum of the OK zone.protected void setWarnMin(Date warnMin)
warnMin
- the absolute minimum value of the WARN zone.protected void setWarnMin(String warnMin) throws GDateFieldException
warnMin
- the absolute minimum value of the WARN zone.GDateFieldException
- in case the date can not be parsed.protected void setWarnMax(Date warnMax)
warnMax
- the absolute maximum value of the WARN zone.protected void setWarnMax(String warnMax) throws GDateFieldException
warnMax
- the absolute maximum value of the WARN zone.GDateFieldException
- in case the date can not be parsed.protected void setWarnMinRule(GIntervalAbstract.Rule warnMinRule)
warnMinRule
- the rule applying to the absolute minimum of the WARN zone.protected void setWarnMaxRule(GIntervalAbstract.Rule warnMaxRule)
warnMaxRule
- the rule applying to the absolute maximum of the WARN zone.protected void removeWarnCheck()
protected GIntervalDate clone()
public 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.