Package net.objecthunter.exp4j.extras
Class FunctionsBoolean
java.lang.Object
net.objecthunter.exp4j.extras.FunctionsBoolean
This class contains a set of commonly used boolean functions and constants.
The boolean value rules are the same the we use in the operators:
- if the absolute value is less than
Operator.BOOLEAN_THRESHOLDit will be consideredfalse. - if the absolute value is bigger or equal than
Operator.BOOLEAN_THRESHOLDit will be consideredtrue - the recommended approach is to use functions or operators that return
boolean values, like the comparison operators or the
TRUEandFALSEconstants - the
TRUEconstant will always return 1.0 andFALSEwill always return 0.0
- Since:
- 0.6-riddler
- Author:
- Federico Vera <[email protected]>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FunctionLogical functionANDstatic final FunctionBoolean valuefalse->0.0.static final FunctionLogical functionNANDstatic final FunctionLogical functionNORstatic final FunctionLogical functionNOTstatic final FunctionLogical functionORstatic final FunctionBoolean valuetrue->1.0.static final FunctionLogical functionXNORstatic final FunctionLogical functionXOR -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctiongetFunction(String name) Get the function for a given namestatic Function[]Array with all the available functions
-
Field Details
-
NOT
Logical functionNOTa | ~a --+-- 0 | 1 1 | 0- Since:
- 0.6-riddler
- See Also:
-
Operators.NOT
-
AND
Logical functionANDa | b | a&b --+---+---- 0 | 0 | 0 0 | 1 | 0 1 | 0 | 0 1 | 1 | 1- Since:
- 0.6-riddler
- See Also:
-
Operators.AND
-
OR
Logical functionORa | b | a|b --+---+---- 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1- Since:
- 0.6-riddler
- See Also:
-
Operators.OR
-
XOR
Logical functionXORa | b | a^b --+---+---- 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0- Since:
- 0.6-riddler
-
NAND
Logical functionNANDa | b | !(a&b) --+---+------- 0 | 0 | 1 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0- Since:
- 0.6-riddler
-
NOR
Logical functionNORa | b | !(a|b) --+---+------- 0 | 0 | 1 0 | 1 | 0 1 | 0 | 0 1 | 1 | 1- Since:
- 0.6-riddler
-
XNOR
Logical functionXNORa | b | !(a^b) --+---+------- 0 | 0 | 1 0 | 1 | 0 1 | 0 | 0 1 | 1 | 1- Since:
- 0.6-riddler
-
FALSE
Boolean valuefalse->0.0.- Since:
- 0.6-riddler
-
TRUE
Boolean valuetrue->1.0.- Since:
- 0.6-riddler
-
-
Method Details
-
getFunctions
Array with all the available functions -
getFunction
Get the function for a given name
-