Class ParameterValue


  • public class ParameterValue
    extends Object
    Class that represents values for a parameter related to a capability that a device or blueprint has.
    Author:
    hylli
    • Constructor Detail

      • ParameterValue

        public ParameterValue​(Parameter parameter,
                              Capability capability)
        Create a new ParameterValue for a capability.
        Parameters:
        parameter - the parameter
        capability - the capability this value is related to
    • Method Detail

      • getParameter

        public Parameter getParameter()
        Return information about the parameter whose values this represents.
        Returns:
        the parameter
      • getValues

        public List<Object> getValues()
        Give the values for the parameter.
        Returns:
        the values
      • getValue

        public String getValue()
        Combine the different values into a string separated by commas.
        Returns:
        values in a string
      • addValue

        public void addValue​(Object value)
        Add a value for the parameter
        Parameters:
        value - the value
      • removeValue

        public boolean removeValue​(Object value)
        Remove the given value from the values of this ParameterValue.
        Parameters:
        value - a value of this ParameterValue
        Returns:
        True if the ParameterValue had the given value false otherwise.
      • replaceValue

        public boolean replaceValue​(Object oldVal,
                                    Object newVal)
        Replace a value with another value.
        Parameters:
        oldVal - value to be replaced
        newVal - the new value
        Returns:
        True if this had olDvalue as a value and it was replaced false otherwise.
      • getCapability

        public Capability getCapability()
        Get the capability to which these parameter values are related to
        Returns:
        the capability
      • clearValues

        public void clearValues()
        Remove all values.
      • setValue

        public void setValue​(Object value)
        Clears existing values if any and adds the given value. In other words after calling this method the parameter value has just the given value as its value.
        Parameters:
        value - the new value of this parameter value