Class ParameterValue
- java.lang.Object
-
- fi.tut.mei.capabilityQueryLib.model.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 Summary
Constructors Constructor Description ParameterValue(Parameter parameter, Capability capability)
Create a new ParameterValue for a capability.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(Object value)
Add a value for the parametervoid
clearValues()
Remove all values.Capability
getCapability()
Get the capability to which these parameter values are related toParameter
getParameter()
Return information about the parameter whose values this represents.String
getValue()
Combine the different values into a string separated by commas.List<Object>
getValues()
Give the values for the parameter.boolean
removeValue(Object value)
Remove the given value from the values of this ParameterValue.boolean
replaceValue(Object oldVal, Object newVal)
Replace a value with another value.void
setValue(Object value)
Clears existing values if any and adds the given value.
-
-
-
Constructor Detail
-
ParameterValue
public ParameterValue(Parameter parameter, Capability capability)
Create a new ParameterValue for a capability.- Parameters:
parameter
- the parametercapability
- 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
-
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 replacednewVal
- 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
-
-