Package com.complexible.common.base
Enum Bool
- java.lang.Object
-
- java.lang.Enum<Bool>
-
- com.complexible.common.base.Bool
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Bool>
public enum Bool extends java.lang.Enum<Bool>
Three-valued (true, false, unknown) boolean type. The standard boolean operators are supported. The following truth table gives the results the unary negation operator:not T F F T U U
The truth table for boolean operators is as follows:and or T T T T T F F T T U U T F F F F F U U U U U U U
- Since:
- 2.0
- Version:
- 2.0
- Author:
- Evren Sirin
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Bool
and(Bool other)
abstract boolean
isFalse()
abstract boolean
isKnown()
abstract boolean
isTrue()
abstract Bool
not()
abstract Bool
or(Bool other)
static Bool
valueOf(boolean value)
Returns the enum constant of this type with the specified name.static Bool
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static Bool[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static Bool[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Bool c : Bool.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Bool valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
valueOf
public static Bool valueOf(boolean value)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
value
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
isFalse
public abstract boolean isFalse()
-
isKnown
public abstract boolean isKnown()
-
isTrue
public abstract boolean isTrue()
-
not
public abstract Bool not()
-
-