com.sdm.quasar.client.core.states
Class MutableBooleanState

java.lang.Object
  extended bycom.sdm.quasar.client.core.states.AbstractState
      extended bycom.sdm.quasar.client.core.states.AbstractBooleanState
          extended bycom.sdm.quasar.client.core.states.MutableBooleanState
All Implemented Interfaces:
BooleanState, Disposable, State

public class MutableBooleanState
extends AbstractBooleanState

A very simple implementation of BooleanState.

Note: MutableBooleanState is thread-save, so it might be changed even in non-edt-threads (althrough it is not recommended).

Version:
1.0
Author:
Thomas Wolf

Constructor Summary
MutableBooleanState()
          Creates a new MutableBooleanState.
MutableBooleanState(boolean enabled)
          Creates a new MutableBooleanState.
MutableBooleanState(java.lang.String name)
          Creates a new MutableBooleanState.
MutableBooleanState(java.lang.String name, boolean enabled)
          Creates a new MutableBooleanState.
 
Method Summary
 void setValue(boolean enabled)
          Sets the enabled state of this BooleanState.
 
Methods inherited from class com.sdm.quasar.client.core.states.AbstractBooleanState
getValue, isValueTrue, setValueWithoutNotification
 
Methods inherited from class com.sdm.quasar.client.core.states.AbstractState
addStateListener, appendParametersToString, dispose, fireStateChanged, getName, removeStateListener, setName, stateValueToString, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sdm.quasar.client.core.states.State
addStateListener, getName, removeStateListener, setName
 
Methods inherited from interface com.sdm.quasar.client.core.common.Disposable
dispose
 

Constructor Detail

MutableBooleanState

public MutableBooleanState()
Creates a new MutableBooleanState.


MutableBooleanState

public MutableBooleanState(java.lang.String name)
Creates a new MutableBooleanState.

Parameters:
name - the name of this BooleanState (not null)

MutableBooleanState

public MutableBooleanState(boolean enabled)
Creates a new MutableBooleanState.

Parameters:
enabled - the initial enabled state. Note, that this does not yet fire a state change (we still have no listeners). The first state change will be fired, when the state changes different from the given initial state.

MutableBooleanState

public MutableBooleanState(java.lang.String name,
                           boolean enabled)
Creates a new MutableBooleanState.

Parameters:
name - the name of this BooleanState (not null)
enabled - the initial enabled state. Note, that this does not yet fire a state change (we still have no listeners). The first state change will be fired, when the state changes different from the given initial state.
Method Detail

setValue

public void setValue(boolean enabled)
Sets the enabled state of this BooleanState. If the enablement changes in respect to this call, all registered listeners will get notified.

Overrides:
setValue in class AbstractBooleanState
Parameters:
enabled - the enabled state.