- java.lang.Object
-
- java.lang.Enum<Tristate>
-
- org.logicng.datastructures.Tristate
-
- All Implemented Interfaces:
Serializable,Comparable<Tristate>
public enum Tristate extends Enum<Tristate>
A tristate constant. This constant can have three different values:TRUE,FALSE, andUNDEF.- Since:
- 1.0
- Version:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TristatefromBool(boolean b)Constructs a tristate constant from an ordinary Boolean value.static Tristatenegate(Tristate l)Returns the negation of a tristate constant.static TristatevalueOf(String name)Returns the enum constant of this type with the specified name.static Tristate[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static Tristate[] 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 (Tristate c : Tristate.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Tristate valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
negate
public static Tristate negate(Tristate l)
Returns the negation of a tristate constant.- Parameters:
l- the tristate constant- Returns:
- the negation of the tristate constant
-
fromBool
public static Tristate fromBool(boolean b)
Constructs a tristate constant from an ordinary Boolean value.- Parameters:
b- the Boolean value- Returns:
- the tristate constant
-
-