Enum Class Tri

java.lang.Object
java.lang.Enum<Tri>
com.google.javascript.jscomp.base.Tri
All Implemented Interfaces:
Serializable, Comparable<Tri>, Constable

public enum Tri extends Enum<Tri>
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:
  • Enum Constant Details

    • FALSE

      public static final Tri FALSE
    • UNKNOWN

      public static final Tri UNKNOWN
    • TRUE

      public static final Tri TRUE
  • Method Details

    • values

      public static Tri[] 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 Tri 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
    • or

      public Tri or(Tri x)
    • and

      public Tri and(Tri x)
    • xor

      public Tri xor(Tri x)
    • not

      public Tri not()
    • toBoolean

      public boolean toBoolean(boolean x)
    • forBoolean

      public static Tri forBoolean(boolean x)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Tri>