javax.sound.sampled
Class BooleanControl

java.lang.Object
  extended by javax.sound.sampled.Control
      extended by javax.sound.sampled.BooleanControl

public abstract class BooleanControl
extends Control

A BooleanControl is a Control which has two states.

Since:
1.3

Nested Class Summary
static class BooleanControl.Type
          A Type specialized to represent a boolean control.
 
Constructor Summary
protected BooleanControl(BooleanControl.Type type, boolean init)
          Create a new boolean control, with the indicated Type and initial value.
protected BooleanControl(BooleanControl.Type type, boolean init, String trueLabel, String falseLabel)
          Create a new boolean control, with the indicated Type, initial value, and labels.
 
Method Summary
 String getStateLabel(boolean state)
          Return the label corresponding to the indicated state.
 boolean getValue()
          Return the current value of thhe control.
 void setValue(boolean value)
          Set the value of the control as indicated.
 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

BooleanControl

protected BooleanControl(BooleanControl.Type type,
                         boolean init)
Create a new boolean control, with the indicated Type and initial value. The description strings will default to "true" and "false".

Parameters:
type - the type
init - the initial value

BooleanControl

protected BooleanControl(BooleanControl.Type type,
                         boolean init,
                         String trueLabel,
                         String falseLabel)
Create a new boolean control, with the indicated Type, initial value, and labels.

Parameters:
type - the type
init - the initial value
trueLabel - the label for the true state
falseLabel - the label for the false state
Method Detail

getStateLabel

public String getStateLabel(boolean state)
Return the label corresponding to the indicated state.

Parameters:
state - the state
Returns:
the true label or the false label, as appropriate

getValue

public boolean getValue()
Return the current value of thhe control.


setValue

public void setValue(boolean value)
Set the value of the control as indicated.

Parameters:
value - the new value

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)