Package org.epics.vtype
Class Display
- java.lang.Object
-
- org.epics.vtype.Display
-
public abstract class Display extends Object
Limit and unit information needed for display and control.The numeric limits are given in double precision no matter which numeric type. The unit is a simple String, which can be empty if no unit information is provided. The number format can be used to convert the value to a String.
- Author:
- carcassi
-
-
Constructor Summary
Constructors Constructor Description Display()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static NumberFormat
defaultNumberFormat()
The default number format for number display.static String
defaultUnits()
The default unit string.static Display
displayOf(Object value)
Null and non-VType safe utility to extract display information.boolean
equals(Object obj)
abstract org.epics.util.stats.Range
getAlarmRange()
The range for the alarm associated to the value.abstract org.epics.util.stats.Range
getControlRange()
The range used for changing the value.abstract String
getDescription()
Human-readable description of the underlying data, e.g.abstract org.epics.util.stats.Range
getDisplayRange()
The range for the value when displayed.abstract NumberFormat
getFormat()
Returns a NumberFormat that creates a String with just the value (no units).abstract String
getUnit()
String representation of the unit using for all values.abstract org.epics.util.stats.Range
getWarningRange()
The range for the warning associated to the value.int
hashCode()
Alarm
newAlarmFor(Number value)
Alarm based on the value and the display ranges.static Display
none()
Empty display information.static Display
of(org.epics.util.stats.Range displayRange, org.epics.util.stats.Range alarmRange, org.epics.util.stats.Range warningRange, org.epics.util.stats.Range controlRange, String units, NumberFormat numberFormat)
Creates a new display.static Display
of(org.epics.util.stats.Range displayRange, org.epics.util.stats.Range alarmRange, org.epics.util.stats.Range warningRange, org.epics.util.stats.Range controlRange, String units, NumberFormat numberFormat, String description)
Creates a new display.String
toString()
-
-
-
Method Detail
-
getDisplayRange
public abstract org.epics.util.stats.Range getDisplayRange()
The range for the value when displayed.- Returns:
- the display range; can be Range.UNDEFINED but not null
-
getAlarmRange
public abstract org.epics.util.stats.Range getAlarmRange()
The range for the alarm associated to the value.- Returns:
- the alarm range; can be Range.UNDEFINED but not null
-
getWarningRange
public abstract org.epics.util.stats.Range getWarningRange()
The range for the warning associated to the value.- Returns:
- the warning range; can be Range.UNDEFINED but not null
-
getControlRange
public abstract org.epics.util.stats.Range getControlRange()
The range used for changing the value.- Returns:
- the control range; can be Range.UNDEFINED but not null
-
getUnit
public abstract String getUnit()
String representation of the unit using for all values. Never null. If not available, returns the empty String.- Returns:
- unit
-
getFormat
public abstract NumberFormat getFormat()
Returns a NumberFormat that creates a String with just the value (no units). Format is locale independent and should be used for all values (values and min/max of the ranges). Never null.- Returns:
- the default format for all values
-
getDescription
public abstract String getDescription()
Human-readable description of the underlying data, e.g. the DESC field of an EPICS record.- Returns:
- description, or
null
if not set.
-
newAlarmFor
public Alarm newAlarmFor(Number value)
Alarm based on the value and the display ranges.- Parameters:
value
- the value- Returns:
- the new alarm
-
of
public static Display of(org.epics.util.stats.Range displayRange, org.epics.util.stats.Range alarmRange, org.epics.util.stats.Range warningRange, org.epics.util.stats.Range controlRange, String units, NumberFormat numberFormat)
Creates a new display.- Parameters:
displayRange
- the display rangewarningRange
- the warning rangealarmRange
- the alarm rangecontrolRange
- the control rangeunits
- the unitsnumberFormat
- the preferred number format- Returns:
- a new display
-
of
public static Display of(org.epics.util.stats.Range displayRange, org.epics.util.stats.Range alarmRange, org.epics.util.stats.Range warningRange, org.epics.util.stats.Range controlRange, String units, NumberFormat numberFormat, String description)
Creates a new display.- Parameters:
displayRange
- the display rangewarningRange
- the warning rangealarmRange
- the alarm rangecontrolRange
- the control rangeunits
- the unitsnumberFormat
- the preferred number formatdescription
- a human-readable description of the underlying data.- Returns:
- a new display
-
defaultNumberFormat
public static NumberFormat defaultNumberFormat()
The default number format for number display.- Returns:
- a number format
-
defaultUnits
public static String defaultUnits()
The default unit string.- Returns:
- an empty string
-
none
public static Display none()
Empty display information.- Returns:
- no display
-
-