Class PsyBoolean

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

@Type("boolean") public final class PsyBoolean extends Object implements PsyAtomic, PsyScalar<PsyBoolean>, PsyLogical<PsyBoolean>
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()
      Specified by:
      toSyntaxString in interface PsyObject
      Returns:
      a string false or true depending on this object value.
    • psyNot

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

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

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

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

      public PsyBoolean psyEq(PsyObject o)
      Returns a result of equality test of this object and given object.
      Specified by:
      psyEq in interface PsyObject
      Returns:
      a result.
    • psyCmp

      public PsyInteger psyCmp(PsyBoolean oBoolean)
      Description copied from interface: PsyScalar
      Compares this object against given object and returns an integer indicating the result of the comparison. Returns negative value if this object is less than given one, zero if this object is equal to given one, and positive value if this object is greater than given one.
      Specified by:
      psyCmp in interface PsyScalar<PsyBoolean>
      Parameters:
      oBoolean - an object with which this object is compared.
      Returns:
      a result of the comparison.
    • psyLt

      public PsyBoolean psyLt(PsyBoolean oBoolean)
      Description copied from interface: PsyScalar
      Returns a boolean object representing the result of “less” comparison of this object and a given object.
      Specified by:
      psyLt in interface PsyScalar<PsyBoolean>
      Parameters:
      oBoolean - an object with which this object is compared.
      Returns:
      a boolean value indicating if this object is less than given object.
    • psyLe

      public PsyBoolean psyLe(PsyBoolean oBoolean)
      Description copied from interface: PsyScalar
      Returns a boolean object representing the result of “less or equal” comparison of this object and a given object.
      Specified by:
      psyLe in interface PsyScalar<PsyBoolean>
      Parameters:
      oBoolean - an object with which this object is compared.
      Returns:
      a boolean value indicating if this object is less than or equal to given object.
    • psyGt

      public PsyBoolean psyGt(PsyBoolean oBoolean)
      Description copied from interface: PsyScalar
      Returns a boolean object representing the result of “greater” comparison of this object and a given object.
      Specified by:
      psyGt in interface PsyScalar<PsyBoolean>
      Parameters:
      oBoolean - an object with which this object is compared.
      Returns:
      a boolean result of comparison.
    • psyGe

      public PsyBoolean psyGe(PsyBoolean oBoolean)
      Description copied from interface: PsyScalar
      Returns a boolean object representing the result of “greater or equal” comparison of this object and a given object.
      Specified by:
      psyGe in interface PsyScalar<PsyBoolean>
      Parameters:
      oBoolean - an object with which this object is compared.
      Returns:
      a boolean result of comparison.
    • 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 object.