Class PsyBoolean

java.lang.Object
coneforest.psylla.core.PsyBoolean
All Implemented Interfaces:
PsyLogical<PsyBoolean>, PsyObject, PsyScalar<PsyBoolean>, PsyValue, Comparable<PsyBoolean>

@Type("boolean") public final class PsyBoolean extends Object implements PsyLogical<PsyBoolean>, PsyScalar<PsyBoolean>, PsyValue
The representation of boolean.
  • Field Details

    • FALSE

      public static final PsyBoolean FALSE
      A boolean constant, representing false.
    • TRUE

      public static final PsyBoolean TRUE
      A boolean constant, representing true.
  • Method Details

    • booleanValue

      public boolean booleanValue()
      Returns a boolean value of this object.
      Returns:
      a boolean value of this object
    • toSyntaxString

      public String toSyntaxString()
      Returns a string false or true depending on this object value.
      Specified by:
      toSyntaxString in interface PsyObject
      Returns:
      a string false or true depending on this object value
    • psyNot

      public PsyBoolean psyNot()
      Returns a boolean result of boolean negation of this object.
      Specified by:
      psyNot in interface PsyLogical<PsyBoolean>
      Returns:
      a boolean result of boolean negation of this object
    • psyOr

      public PsyBoolean psyOr(PsyBoolean oBoolean)
      Returns a boolean result of boolean disjunction of this object and given object.
      Specified by:
      psyOr in interface PsyLogical<PsyBoolean>
      Parameters:
      oBoolean - given object.
      Returns:
      a boolean result of boolean disjunction of this object and given object
    • psyAnd

      public PsyBoolean psyAnd(PsyBoolean oBoolean)
      Returns a boolean result of boolean conjunction of this object and given object.
      Specified by:
      psyAnd in interface PsyLogical<PsyBoolean>
      Parameters:
      oBoolean - given object.
      Returns:
      a boolean result of boolean conjunction of this object and given object
    • psyXor

      public PsyBoolean psyXor(PsyBoolean oBoolean)
      Returns a boolean result of boolean exclusive disjunction of this object and given object.
      Specified by:
      psyXor in interface PsyLogical<PsyBoolean>
      Parameters:
      oBoolean - given object.
      Returns:
      a boolean result of boolean exclusive disjunction of this object and given object
    • psyEq

      public PsyBoolean psyEq(PsyObject o)
      Description copied from interface: PsyObject
      Returns a boolean result of equality test of this object and given object.
      Specified by:
      psyEq in interface PsyObject
      Parameters:
      o - the object to be compared for equality.
      Returns:
      a boolean result of equality test of this object and given object
    • compareTo

      public int compareTo(PsyBoolean oBoolean)
      Description copied from interface: PsyScalar
      Compares this scalar with the specified scalar for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified scalar.
      Specified by:
      compareTo in interface Comparable<PsyBoolean>
      Specified by:
      compareTo in interface PsyScalar<PsyBoolean>
      Parameters:
      oBoolean - the scalar to be compared.
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • of

      public static PsyBoolean of(boolean bool)
      Returns a boolean representing the given boolean value.
      Parameters:
      bool - a given value.
      Returns:
      a boolean representing the given boolean value