Package ch.njol.util

Enum Class Kleenean

java.lang.Object
java.lang.Enum<Kleenean>
ch.njol.util.Kleenean
All Implemented Interfaces:
Serializable, Comparable<Kleenean>, Constable

public enum Kleenean extends Enum<Kleenean>
A three-valued logic type (true, unknown, false), named after Stephen Cole Kleene.
  • Enum Constant Details

    • FALSE

      public static final Kleenean FALSE
      100% false
    • UNKNOWN

      public static final Kleenean UNKNOWN
      Unknown state
    • TRUE

      public static final Kleenean TRUE
      100% true
  • Method Details

    • values

      public static Kleenean[] 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

      public static Kleenean valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • toString

      public final String toString()
      Overrides:
      toString in class Enum<Kleenean>
    • is

      public final Kleenean is(Kleenean other)
    • and

      public final Kleenean and(Kleenean other)
    • or

      public final Kleenean or(Kleenean other)
    • not

      public final Kleenean not()
    • implies

      public final Kleenean implies(Kleenean other)
    • 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

      public static Kleenean get(boolean b)
      Parameters:
      b -
      Returns:
      b ? TRUE : FALSE
    • get

      public static Kleenean get(int i)
      Parameters:
      i -
      Returns:
      i > 0 ? TRUE : i invalid input: '<' 0 ? FALSE : UNKNOWN
    • get

      public static Kleenean get(double d)
      Parameters:
      d -
      Returns:
      return d > 0 ? TRUE : d invalid input: '<' 0 ? FALSE : UNKNOWN