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

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

public class XORBooleanState
extends AbstractCombinedBooleanState

A BooleanState that combines a set of other boolean states with the logical XOR operation.

Version:
1.0
Author:
Thomas Wolf

Field Summary
 
Fields inherited from class com.sdm.quasar.client.core.states.AbstractCombinedBooleanState
OPERATION_AND, OPERATION_OR, OPERATION_XOR
 
Constructor Summary
XORBooleanState(java.lang.String name)
          Creates a new XORBooleanState.
XORBooleanState(java.lang.String name, BooleanState[] states, boolean[] signs)
          Creates a new XORBooleanState.
 
Method Summary
static XORBooleanState create(java.lang.String name, BooleanState state1)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, boolean sign1)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, boolean sign1, BooleanState state2, boolean sign2)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, boolean sign1, BooleanState state2, boolean sign2, BooleanState state3, boolean sign3)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, boolean sign1, BooleanState state2, boolean sign2, BooleanState state3, boolean sign3, BooleanState state4, boolean sign4)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, boolean sign1, BooleanState state2, boolean sign2, BooleanState state3, boolean sign3, BooleanState state4, boolean sign4, BooleanState state5, boolean sign5)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, boolean sign1, BooleanState state2, boolean sign2, BooleanState state3, boolean sign3, BooleanState state4, boolean sign4, BooleanState state5, boolean sign5, BooleanState state6, boolean sign6)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, BooleanState state2)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, BooleanState state2, BooleanState state3)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, BooleanState state2, BooleanState state3, BooleanState state4)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, BooleanState state2, BooleanState state3, BooleanState state4, BooleanState state5)
          Creates a new XORBooleanState.
static XORBooleanState create(java.lang.String name, BooleanState state1, BooleanState state2, BooleanState state3, BooleanState state4, BooleanState state5, BooleanState state6)
          Creates a new XORBooleanState.
 
Methods inherited from class com.sdm.quasar.client.core.states.AbstractCombinedBooleanState
add, dispose, get, getCount, getOperation, getSign, remove, remove, toString
 
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, fireStateChanged, getName, removeStateListener, setName, stateValueToString, 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
 

Constructor Detail

XORBooleanState

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

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

XORBooleanState

public XORBooleanState(java.lang.String name,
                       BooleanState[] states,
                       boolean[] signs)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
states - an array of States to watch (if null, no states are watched).
signs - an array of signs for the States (if the array is null or the length does not match the one of the states array, missing signs are threated as true, too many signs are ignored)
Method Detail

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     boolean sign1)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
sign1 - the sign of the first BooleanState (true for positive, false for negated)
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     boolean sign1,
                                     BooleanState state2,
                                     boolean sign2)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
sign1 - the sign of the first BooleanState (true for positive, false for negated)
state2 - the second BooleanState to add
sign2 - the sign of the second BooleanState (true for positive, false for negated)
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     boolean sign1,
                                     BooleanState state2,
                                     boolean sign2,
                                     BooleanState state3,
                                     boolean sign3)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
sign1 - the sign of the first BooleanState (true for positive, false for negated)
state2 - the second BooleanState to add
sign2 - the sign of the second BooleanState (true for positive, false for negated)
state3 - the third BooleanState to add
sign3 - the sign of the third BooleanState (true for positive, false for negated)
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     boolean sign1,
                                     BooleanState state2,
                                     boolean sign2,
                                     BooleanState state3,
                                     boolean sign3,
                                     BooleanState state4,
                                     boolean sign4)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
sign1 - the sign of the first BooleanState (true for positive, false for negated)
state2 - the second BooleanState to add
sign2 - the sign of the second BooleanState (true for positive, false for negated)
state3 - the third BooleanState to add
sign3 - the sign of the third BooleanState (true for positive, false for negated)
state4 - the fourth BooleanState to add
sign4 - the sign of the fourth BooleanState (true for positive, false for negated)
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     boolean sign1,
                                     BooleanState state2,
                                     boolean sign2,
                                     BooleanState state3,
                                     boolean sign3,
                                     BooleanState state4,
                                     boolean sign4,
                                     BooleanState state5,
                                     boolean sign5)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
sign1 - the sign of the first BooleanState (true for positive, false for negated)
state2 - the second BooleanState to add
sign2 - the sign of the second BooleanState (true for positive, false for negated)
state3 - the third BooleanState to add
sign3 - the sign of the third BooleanState (true for positive, false for negated)
state4 - the fourth BooleanState to add
sign4 - the sign of the fourth BooleanState (true for positive, false for negated)
state5 - the fifth BooleanState to add
sign5 - the sign of the fifth BooleanState (true for positive, false for negated)
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     boolean sign1,
                                     BooleanState state2,
                                     boolean sign2,
                                     BooleanState state3,
                                     boolean sign3,
                                     BooleanState state4,
                                     boolean sign4,
                                     BooleanState state5,
                                     boolean sign5,
                                     BooleanState state6,
                                     boolean sign6)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
sign1 - the sign of the first BooleanState (true for positive, false for negated)
state2 - the second BooleanState to add
sign2 - the sign of the second BooleanState (true for positive, false for negated)
state3 - the third BooleanState to add
sign3 - the sign of the third BooleanState (true for positive, false for negated)
state4 - the fourth BooleanState to add
sign4 - the sign of the fourth BooleanState (true for positive, false for negated)
state5 - the fifth BooleanState to add
sign5 - the sign of the fifth BooleanState (true for positive, false for negated)
state6 - the sixth BooleanState to add
sign6 - the sign of the sixth BooleanState (true for positive, false for negated)
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     BooleanState state2)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
state2 - the second BooleanState to add
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     BooleanState state2,
                                     BooleanState state3)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
state2 - the second BooleanState to add
state3 - the third BooleanState to add
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     BooleanState state2,
                                     BooleanState state3,
                                     BooleanState state4)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
state2 - the second BooleanState to add
state3 - the third BooleanState to add
state4 - the fourth BooleanState to add
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     BooleanState state2,
                                     BooleanState state3,
                                     BooleanState state4,
                                     BooleanState state5)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
state2 - the second BooleanState to add
state3 - the third BooleanState to add
state4 - the fourth BooleanState to add
state5 - the fifth BooleanState to add
Returns:
the created XORBooleanState

create

public static XORBooleanState create(java.lang.String name,
                                     BooleanState state1,
                                     BooleanState state2,
                                     BooleanState state3,
                                     BooleanState state4,
                                     BooleanState state5,
                                     BooleanState state6)
Creates a new XORBooleanState.

Parameters:
name - the name of this XORBooleanState (not null)
state1 - the first BooleanState to add
state2 - the second BooleanState to add
state3 - the third BooleanState to add
state4 - the fourth BooleanState to add
state5 - the fifth BooleanState to add
state6 - the sixth BooleanState to add
Returns:
the created XORBooleanState