Package adams.flow.condition.bool
Class Xor
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<BooleanCondition>,SizeOfHandler,Stoppable,BooleanCondition,BooleanConditionWithSimplification,Serializable
public class Xor extends AbstractBooleanCondition implements BooleanConditionWithSimplification
Combines the specified conditions using a logical XOR (exclusive OR).
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING min-user-mode: Expert
-first <adams.flow.condition.bool.BooleanCondition> (property: first) The first boolean condition in the XOR. default: adams.flow.condition.bool.True
-second <adams.flow.condition.bool.BooleanCondition> (property: second) The second boolean condition in the XOR. default: adams.flow.condition.bool.False
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BooleanConditionm_Firstthe first condition.protected BooleanConditionm_Secondthe second condition.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Xor()Default constructorXor(BooleanCondition first, BooleanCondition second)Initializes the object with the specified conditions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class[]accepts()Returns the class that the consumer accepts.voiddefineOptions()Adds options to the internal list of options.protected booleandoEvaluate(Actor owner, Token token)Performs the actual evaluation.StringfirstTipText()Returns the tip text for this property.BooleanConditiongetFirst()Returns the first condition to evaluate.StringgetQuickInfo()Returns the quick info string to be displayed in the flow editor.BooleanConditiongetSecond()Returns the second condition to evaluate.StringglobalInfo()Returns a string describing the object.StringsecondTipText()Returns the tip text for this property.voidsetFirst(BooleanCondition value)Sets the first condition to evaluate.voidsetSecond(BooleanCondition value)Sets the second condition to evaluate.BooleanConditionsimplify()Returns a simplified boolean condition, if possible.voidstopExecution()Stops the execution.-
Methods inherited from class adams.flow.condition.bool.AbstractBooleanCondition
evaluate, preEvaluate, setUp, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.condition.bool.BooleanCondition
evaluate, setUp, shallowCopy, shallowCopy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_First
protected BooleanCondition m_First
the first condition.
-
m_Second
protected BooleanCondition m_Second
the second condition.
-
-
Constructor Detail
-
Xor
public Xor()
Default constructor
-
Xor
public Xor(BooleanCondition first, BooleanCondition second)
Initializes the object with the specified conditions.- Parameters:
first- the first condition to usesecond- the second condition to use
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setFirst
public void setFirst(BooleanCondition value)
Sets the first condition to evaluate.- Parameters:
value- the condition
-
getFirst
public BooleanCondition getFirst()
Returns the first condition to evaluate.- Returns:
- the condition
-
firstTipText
public String firstTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSecond
public void setSecond(BooleanCondition value)
Sets the second condition to evaluate.- Parameters:
value- the condition
-
getSecond
public BooleanCondition getSecond()
Returns the second condition to evaluate.- Returns:
- the condition
-
secondTipText
public String secondTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns the quick info string to be displayed in the flow editor.- Specified by:
getQuickInfoin interfaceBooleanCondition- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Specified by:
getQuickInfoin classAbstractBooleanCondition- Returns:
- the info or null if no info to be displayed
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
acceptsin interfaceBooleanCondition- Specified by:
acceptsin classAbstractBooleanCondition- Returns:
- adams.flow.core.Unknown.class
-
doEvaluate
protected boolean doEvaluate(Actor owner, Token token)
Performs the actual evaluation.- Specified by:
doEvaluatein classAbstractBooleanCondition- Parameters:
owner- the owning actortoken- the current token passing through- Returns:
- the result of the evaluation
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceBooleanCondition- Specified by:
stopExecutionin interfaceStoppable- Overrides:
stopExecutionin classAbstractBooleanCondition
-
simplify
public BooleanCondition simplify()
Returns a simplified boolean condition, if possible.- Specified by:
simplifyin interfaceBooleanConditionWithSimplification- Returns:
- a potentially simplified boolean condition
-
-