Class Threshold
- java.lang.Object
-
- org.pepstock.charba.client.impl.charts.Threshold
-
public final class Threshold extends Object
Is the threshold to use for gauge chart.- Author:
- Andrea "Stock" Stocchero
-
-
Field Summary
Fields Modifier and Type Field Description static IsColor
DEFAULT_VALUE_COLOR
Default color value,DefaultThreshold.NORMAL
.
-
Constructor Summary
Constructors Constructor Description Threshold(String name)
Creates a threshold with standard color (DEFAULT_VALUE_COLOR
) and value (Double.MAX_VALUE
).Threshold(String name, double value)
Creates a threshold with standard color (DEFAULT_VALUE_COLOR
).Threshold(String name, double value, IsColor color)
Creates a thresholdThreshold(String name, IsColor color)
Creates a threshold with standard value (Double.MAX_VALUE
).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IsColor
getColor()
String
getName()
double
getValue()
boolean
isInRange(double valueToCheck, double lowLimit)
Checks if the value passed is in the threshold.Threshold
setColor(IsColor color)
Sets the color of threshold.Threshold
setValue(double value)
Sets the value of threshold.
-
-
-
Field Detail
-
DEFAULT_VALUE_COLOR
public static final IsColor DEFAULT_VALUE_COLOR
Default color value,DefaultThreshold.NORMAL
.
-
-
Constructor Detail
-
Threshold
public Threshold(String name)
Creates a threshold with standard color (DEFAULT_VALUE_COLOR
) and value (Double.MAX_VALUE
).- Parameters:
name
- name of threshold
-
Threshold
public Threshold(String name, IsColor color)
Creates a threshold with standard value (Double.MAX_VALUE
).- Parameters:
name
- name of thresholdcolor
- color of threshold
-
Threshold
public Threshold(String name, double value)
Creates a threshold with standard color (DEFAULT_VALUE_COLOR
).- Parameters:
name
- name of thresholdvalue
- value of threshold
-
-
Method Detail
-
getName
public String getName()
-
getValue
public double getValue()
-
getColor
public IsColor getColor()
-
setValue
public Threshold setValue(double value)
Sets the value of threshold.- Parameters:
value
- the value to set- Returns:
- the threshold instance
-
setColor
public Threshold setColor(IsColor color)
Sets the color of threshold.- Parameters:
color
- the color to set- Returns:
- the threshold instance
-
isInRange
public boolean isInRange(double valueToCheck, double lowLimit)
Checks if the value passed is in the threshold.- Parameters:
valueToCheck
- value to checklowLimit
- the low limit- Returns:
true
is the value is inside the range, otherwisefalse
.
-
-