Class 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 Detail

      • Display

        public Display()
    • 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
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • 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 range
        warningRange - the warning range
        alarmRange - the alarm range
        controlRange - the control range
        units - the units
        numberFormat - 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 range
        warningRange - the warning range
        alarmRange - the alarm range
        controlRange - the control range
        units - the units
        numberFormat - the preferred number format
        description - 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
      • displayOf

        public static Display displayOf​(Object value)
        Null and non-VType safe utility to extract display information.
        • If the value has a display, the associated display is returned.
        • If the value has no display, none() is returned.
        • If the value is null, none() is returned.
        Parameters:
        value - the value
        Returns:
        the display information for the value