Package ch.njol.util
Enum Class Kleenean
- All Implemented Interfaces:
Serializable
,Comparable<Kleenean>
,Constable
A three-valued logic type (true, unknown, false), named after Stephen Cole Kleene.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Kleenean
get(boolean b)
static Kleenean
get(double d)
static Kleenean
get(int i)
boolean
isFalse()
boolean
isTrue()
boolean
not()
toString()
static Kleenean
Returns the enum constant of this class with the specified name.static Kleenean[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FALSE
100% false -
UNKNOWN
Unknown state -
TRUE
100% 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
-
toString
-
is
-
and
-
or
-
not
-
implies
-
isTrue
public final boolean isTrue()- Returns:
- this == TRUE
-
isUnknown
public final boolean isUnknown()- Returns:
- this == UNKNOWN
-
isFalse
public final boolean isFalse()- Returns:
- this == FALSE
-
get
- Parameters:
b
-- Returns:
- b ? TRUE : FALSE
-
get
- Parameters:
i
-- Returns:
- i > 0 ? TRUE : i < 0 ? FALSE : UNKNOWN
-
get
- Parameters:
d
-- Returns:
- return d > 0 ? TRUE : d < 0 ? FALSE : UNKNOWN
-