public class BooleanValue extends DoubleCompatibleValue
A value which is either true or false. In numerical context true is interpreted as 1 and false as 0.
Author:
bratseth
  • Constructor Details

    • BooleanValue

      public BooleanValue(boolean value)
  • Method Details

    • frozen

      public static BooleanValue frozen(boolean value)
      Create a boolean value which is frozen at the outset.
    • asBoolean

      public boolean asBoolean()
      Description copied from class: Value
      Returns this value as a boolean.
      Specified by:
      asBoolean in class Value
    • asDouble

      public double asDouble()
      Description copied from class: Value
      Returns this value as a double, or throws UnsupportedOperationException if it cannot be represented as a double
      Specified by:
      asDouble in class Value
    • asMutable

      public Value asMutable()
      Description copied from class: Value
      Returns this is mutable, or a mutable copy otherwise
      Specified by:
      asMutable in class Value
    • toString

      public String toString()
      Specified by:
      toString in class Value
    • equals

      public boolean equals(Object other)
      Specified by:
      equals in class Value
    • hashCode

      public int hashCode()
      Description copied from class: Value
      Returns a hash which only depends on the content of this value.
      Specified by:
      hashCode in class Value