javax.sound.sampled
Class EnumControl

java.lang.Object
  extended by javax.sound.sampled.Control
      extended by javax.sound.sampled.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 class EnumControl.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
 Object getValue()
          Return the current value of this control.
 Object[] getValues()
          Return the valid values for this control.
 void setValue(Object value)
          Set the value of this control.
 String toString()
          Return a string describing this control.
 
Methods inherited from class javax.sound.sampled.Control
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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.

Overrides:
toString in class Control
Returns:
the String representing this Object, which may be null
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)