Enum Class Tri
- All Implemented Interfaces:
Serializable
,Comparable<Tri>
,Constable
An enum for ternary logic.
The TRUE
and FALSE
values are equivalent to typical booleans, and the UNKNOWN
value plays the role of a placeholder, which can be either TRUE
or FALSE
.
A ternary value expression evaluates to TRUE
or FALSE
only if all
replacements of UNKNOWN
in this expression yield the same result. Therefore, the ternary
logic coincides with typical Boolean logic if the UNKNOWN
value is not present in an
expression.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Tri
forBoolean
(boolean x) not()
boolean
toBoolean
(boolean x) toString()
static Tri
Returns the enum constant of this class with the specified name.static Tri[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FALSE
-
UNKNOWN
-
TRUE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
or
-
and
-
xor
-
not
-
toBoolean
public boolean toBoolean(boolean x) -
forBoolean
-
toString
-