java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.Vector
org.cybergarage.upnp.AllowedValueList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,List,RandomAccess,SequencedCollection
A list of
AllowedValue objects for a state variable.
This class represents the set of allowed values that constrain a UPnP state variable. It
extends Vector to provide type-safe access to allowed values and includes validation
methods.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe XML element name for allowed value list nodes in SCPD documents.Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementDataFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty allowed value list.AllowedValueList(String[] values) Constructs an allowed value list from an array of strings. -
Method Summary
Modifier and TypeMethodDescriptiongetAllowedValue(int n) Returns the allowed value at the specified index.booleanChecks if the specified value is in the allowed value list.Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Field Details
-
ELEM_NAME
The XML element name for allowed value list nodes in SCPD documents.- See Also:
-
-
Constructor Details
-
AllowedValueList
public AllowedValueList()Constructs an empty allowed value list. -
AllowedValueList
Constructs an allowed value list from an array of strings.- Parameters:
values- the array of allowed value strings
-
-
Method Details
-
getAllowedValue
Returns the allowed value at the specified index.- Parameters:
n- the index of the allowed value to retrieve- Returns:
- the allowed value at the specified index
- Throws:
ArrayIndexOutOfBoundsException- if the index is out of range
-
isAllowed
Checks if the specified value is in the allowed value list.- Parameters:
v- the value string to check- Returns:
trueif the value is allowed,falseotherwise
-