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

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
All Implemented Interfaces:
BooleanState, Disposable, State
Direct Known Subclasses:
StateAcceptedBooleanState, ValueAcceptedBooleanState

public class AcceptorBooleanState
extends AbstractBooleanState

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

For convenience the value of a source object is accepted, if it is equal to a given reference object.

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

Constructor Summary
AcceptorBooleanState(Acceptor acceptor)
          Creates a new AcceptorBooleanState.
AcceptorBooleanState(java.lang.Object compareValue)
          Creates a new AcceptorBooleanState.
AcceptorBooleanState(java.lang.Object compareValue, boolean inverse)
          Creates a new AcceptorBooleanState.
AcceptorBooleanState(java.lang.String name, Acceptor acceptor)
          Creates a new AcceptorBooleanState.
AcceptorBooleanState(java.lang.String name, java.lang.Object compareValue)
          Creates a new AcceptorBooleanState.
AcceptorBooleanState(java.lang.String name, java.lang.Object compareValue, boolean inverse)
          Creates a new AcceptorBooleanState.
 
Method Summary
 Acceptor getAcceptor()
           
 java.lang.Object getSource()
          returns the current source object
 void setAcceptor(Acceptor acceptor)
          sets a new Acceptor
 void setCompareValue(java.lang.Object compareValue)
          Sets the value to compare the state's value with to the given value.
 void setSource(java.lang.Object source)
          sets a new source object
 void updateAdaptedValue()
          Checks, if the current source object is accepted by the acceptor.
 
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

AcceptorBooleanState

public AcceptorBooleanState(java.lang.String name,
                            java.lang.Object compareValue)
Creates a new AcceptorBooleanState.

Parameters:
name - the name of this AcceptorBooleanState (not null)
compareValue - the value to compare (may be null)

AcceptorBooleanState

public AcceptorBooleanState(java.lang.Object compareValue)
Creates a new AcceptorBooleanState.

Parameters:
compareValue - the value to compare (may be null)

AcceptorBooleanState

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

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

AcceptorBooleanState

public AcceptorBooleanState(java.lang.Object compareValue,
                            boolean inverse)
Creates a new AcceptorBooleanState.

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

AcceptorBooleanState

public AcceptorBooleanState(java.lang.String name,
                            Acceptor acceptor)
Creates a new AcceptorBooleanState.

Parameters:
name - the name of this AcceptorBooleanState (not null)
acceptor - the Acceptor responsible for accepting the source States value (may not be null)

AcceptorBooleanState

public AcceptorBooleanState(Acceptor acceptor)
Creates a new AcceptorBooleanState.

Parameters:
acceptor - the Acceptor responsible for accepting the source States value (may not be null)
Method Detail

setCompareValue

public void setCompareValue(java.lang.Object compareValue)
Sets the value to compare the state's value with to the given value.

Parameters:
compareValue - the value to compare with.

getSource

public java.lang.Object getSource()
returns the current source object


getAcceptor

public Acceptor getAcceptor()
Returns:
the current Acceptor

setAcceptor

public void setAcceptor(Acceptor acceptor)
sets a new Acceptor

Parameters:
acceptor - the new Acceptor.

setSource

public void setSource(java.lang.Object source)
sets a new source object

Parameters:
source - the new source.

updateAdaptedValue

public void updateAdaptedValue()
Checks, if the current source object is accepted by the acceptor. The comparison updates the boolean state value of this AcceptorBooleanState.