javax.sound.sampled

Class EnumControl

public abstract class EnumControl extends Control

An EnumControl is a Control which can take one of a specified set of values.

Since: 1.3

Nested Class Summary
static classEnumControl.Type
This Type describes an EnumControl.
Constructor Summary
protected EnumControl(EnumControl.Type type, Object[] values, Object val)
Create a new enumerated control given its Type, the range of valid values, and its initial value.
Method Summary
ObjectgetValue()
Return the current value of this control.
Object[]getValues()
Return the valid values for this control.
voidsetValue(Object value)
Set the value of this control.
StringtoString()
Return a string describing this control.

Constructor Detail

EnumControl

protected EnumControl(EnumControl.Type type, Object[] values, Object val)
Create a new enumerated control given its Type, the range of valid values, and its initial value.

Parameters: type the type values the valid values val the initial value

Method Detail

getValue

public Object getValue()
Return the current value of this control.

getValues

public Object[] getValues()
Return the valid values for this control.

setValue

public void setValue(Object value)
Set the value of this control. If the indicated value is not among the valid values, this method will throw an IllegalArgumentException.

Parameters: value the new value

Throws: IllegalArgumentException if the new value is invalid

toString

public String toString()
Return a string describing this control.