java.lang.Object
org.cybergarage.upnp.AllowedValueRange
Represents an allowed value range for a UPnP state variable.
This class defines a numeric range constraint for state variables, including minimum, maximum, and optional step values. It is used when a state variable can take any numeric value within a specified range.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty allowed value range.AllowedValueRange(Number max, Number min, Number step) Constructs an allowed value range with specified bounds and step.AllowedValueRange(org.cybergarage.xml.Node node) Constructs an allowed value range from an existing XML node. -
Method Summary
Modifier and TypeMethodDescriptionorg.cybergarage.xml.NodeReturns the underlying XML node representing this allowed value range.Returns the maximum allowed value.Returns the minimum allowed value.getStep()Returns the step increment for the range.static booleanisAllowedValueRangeNode(org.cybergarage.xml.Node node) Checks if the given XML node represents an allowed value range element.voidsetMaximum(String value) Sets the maximum allowed value.voidsetMinimum(String value) Sets the minimum allowed value.voidSets the step increment for the range.
-
Field Details
-
ELEM_NAME
The XML element name for allowed value range nodes in SCPD documents.- See Also:
-
-
Constructor Details
-
AllowedValueRange
public AllowedValueRange(org.cybergarage.xml.Node node) Constructs an allowed value range from an existing XML node.- Parameters:
node- the XML node representing the allowed value range
-
AllowedValueRange
public AllowedValueRange()Constructs an empty allowed value range. -
AllowedValueRange
Constructs an allowed value range with specified bounds and step.- Parameters:
max- the maximum allowed value, ornullto omitmin- the minimum allowed value, ornullto omitstep- the step increment, ornullto omit
-
-
Method Details
-
getAllowedValueRangeNode
public org.cybergarage.xml.Node getAllowedValueRangeNode()Returns the underlying XML node representing this allowed value range.- Returns:
- the allowed value range XML node
-
isAllowedValueRangeNode
public static boolean isAllowedValueRangeNode(org.cybergarage.xml.Node node) Checks if the given XML node represents an allowed value range element.- Parameters:
node- the XML node to check- Returns:
trueif the node's name matches the allowed value range element name,falseotherwise
-
setMinimum
Sets the minimum allowed value.- Parameters:
value- the minimum value as a string
-
getMinimum
Returns the minimum allowed value.- Returns:
- the minimum value as a string
-
setMaximum
Sets the maximum allowed value.- Parameters:
value- the maximum value as a string
-
getMaximum
Returns the maximum allowed value.- Returns:
- the maximum value as a string
-
setStep
Sets the step increment for the range.The step defines the granularity of allowed values within the range.
- Parameters:
value- the step increment as a string
-
getStep
Returns the step increment for the range.- Returns:
- the step increment as a string
-