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

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.AcceptorBooleanState
              extended bycom.sdm.quasar.client.core.states.StateAcceptedBooleanState
All Implemented Interfaces:
BooleanState, Disposable, State

public class StateAcceptedBooleanState
extends AcceptorBooleanState

A BooleanState, that adapts the State value (see State.getValue() to the own boolean state value (see BooleanState.isValueTrue()) using an Acceptor: The BooleanState is true, if the Acceptor accepts the State value. (see StateAcceptedBooleanState(State, Acceptor)

For convenience the value of a source state is accepted, if it is equal to a given reference value (see StateAcceptedBooleanState(State, Object), and AcceptorBooleanState.setCompareValue(Object)).

Version:
1.$Revision$
Author:
Thomas Wolf, Martin Haft

Constructor Summary
StateAcceptedBooleanState(State sourceState, Acceptor acceptor)
          Creates a new StateAcceptedBooleanState.
StateAcceptedBooleanState(State sourceState, java.lang.Object compareValue)
          Creates a new StateAcceptedBooleanState.
StateAcceptedBooleanState(State sourceState, java.lang.Object compareValue, boolean inverse)
          Creates a new StateAcceptedBooleanState.
StateAcceptedBooleanState(java.lang.String name, State sourceState, Acceptor acceptor)
          Creates a new StateAcceptedBooleanState.
StateAcceptedBooleanState(java.lang.String name, State sourceState, java.lang.Object compareValue)
          Creates a new StateAcceptedBooleanState.
StateAcceptedBooleanState(java.lang.String name, State sourceState, java.lang.Object compareValue, boolean inverse)
          Creates a new StateAcceptedBooleanState.
 
Method Summary
 State getState()
          returns the currently observed state
 void setState(State state)
          sets a new State
 
Methods inherited from class com.sdm.quasar.client.core.states.AcceptorBooleanState
getAcceptor, getSource, setAcceptor, setCompareValue, setSource, updateAdaptedValue
 
Methods inherited from class com.sdm.quasar.client.core.states.AbstractBooleanState
getValue, isValueTrue, setValue, 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

StateAcceptedBooleanState

public StateAcceptedBooleanState(java.lang.String name,
                                 State sourceState,
                                 java.lang.Object compareValue)
Creates a new StateAcceptedBooleanState.

Parameters:
name - the name of this StateAcceptedBooleanState (not null)
sourceState - the source State to compare value of (may be null)
compareValue - the value to compare (may be null)

StateAcceptedBooleanState

public StateAcceptedBooleanState(State sourceState,
                                 java.lang.Object compareValue)
Creates a new StateAcceptedBooleanState.

Parameters:
sourceState - the source State to compare value of (may be null)
compareValue - the value to compare (may be null)

StateAcceptedBooleanState

public StateAcceptedBooleanState(java.lang.String name,
                                 State sourceState,
                                 java.lang.Object compareValue,
                                 boolean inverse)
Creates a new StateAcceptedBooleanState.

Parameters:
name - the name of this StateAcceptedBooleanState (not null)
sourceState - the source State to compare value of (may be null)
compareValue - the value to compare (may be null)
inverse - if true comparision with not equals

StateAcceptedBooleanState

public StateAcceptedBooleanState(State sourceState,
                                 java.lang.Object compareValue,
                                 boolean inverse)
Creates a new StateAcceptedBooleanState.

Parameters:
sourceState - the source State to compare value of (may be null)
compareValue - the value to compare (may be null)
inverse - if true comparision with not equals

StateAcceptedBooleanState

public StateAcceptedBooleanState(java.lang.String name,
                                 State sourceState,
                                 Acceptor acceptor)
Creates a new StateAcceptedBooleanState.

Parameters:
name - the name of this StateAcceptedBooleanState (not null)
sourceState - the source State, its value is the object for acceptance (may be null)
acceptor - the Acceptor responsible for accepting the source States value (may not be null)

StateAcceptedBooleanState

public StateAcceptedBooleanState(State sourceState,
                                 Acceptor acceptor)
Creates a new StateAcceptedBooleanState.

Parameters:
sourceState - the source State, its value is the object for acceptance (may be null)
acceptor - the Acceptor responsible for accepting the source States value (may not be null)
Method Detail

getState

public State getState()
returns the currently observed state


setState

public void setState(State state)
sets a new State

Parameters:
state - the new State.