org.extex.core
Class Switch

java.lang.Object
  extended by org.extex.core.Switch

public class Switch
extends java.lang.Object

This class provides a modifiable boolean object. In contrast to the class Boolean this class has also a setter for the encapsulated boolean value.

This class cures the deficiency of Java to provide booleans as first-class objects.

Version:
$Revision:5417 $
Author:
Gerd Neugebauer

Constructor Summary
Switch(boolean on)
          Creates a new object with a given boolean value.
 
Method Summary
 boolean isOn()
          Getter for value.
 void set(boolean on)
          Setter for value.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Switch

public Switch(boolean on)
Creates a new object with a given boolean value.

Parameters:
on - the initial value
Method Detail

isOn

public boolean isOn()
Getter for value.

Returns:
the value.

set

public void set(boolean on)
Setter for value.

Parameters:
on - the value to set.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()