javax.sound.sampled

Class BooleanControl

public abstract class BooleanControl extends Control

A BooleanControl is a Control which has two states.

Since: 1.3

Nested Class Summary
static classBooleanControl.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
StringgetStateLabel(boolean state)
Return the label corresponding to the indicated state.
booleangetValue()
Return the current value of thhe control.
voidsetValue(boolean value)
Set the value of the control as indicated.
StringtoString()
Return a string describing this control.

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.