Interface PsyScalar<T extends PsyScalar<T>>

Type Parameters:
T - a type of the second operand at binary comparison operation.
All Superinterfaces:
Comparable<T>, PsyObject
All Known Subinterfaces:
PsyIntegral, PsyRational, PsyRealNumeric, PsyTextual
All Known Implementing Classes:
PsyBigFraction, PsyBigInteger, PsyBoolean, PsyFraction, PsyInteger, PsyName, PsyReal, PsyString, PsyStringBuffer

@Type("scalar") public interface PsyScalar<T extends PsyScalar<T>> extends PsyObject, Comparable<T>
The representation of scalar, a type bringing total ordering to implementing Psylla type. This interface declares methods for comparison.
  • Field Details

  • Method Details

    • compareTo

      int compareTo(T oScalar)
      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<T extends PsyScalar<T>>
      Parameters:
      oScalar - 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.
    • psyLt

      default PsyBoolean psyLt(T oScalar)
      Returns a boolean object representing the result of “less” comparison of this scalar and a given scalar.
      Parameters:
      oScalar - an object with which this object is compared.
      Returns:
      a boolean object representing the result of “less” comparison of this scalar and a given scalar
    • psyLe

      default PsyBoolean psyLe(T oScalar)
      Returns a boolean object representing the result of “less or equal” comparison of this scalar and a given scalar.
      Parameters:
      oScalar - an object with which this object is compared.
      Returns:
      a boolean object representing the result of “less or equal” comparison of this scalar and a given scalar
    • psyGt

      default PsyBoolean psyGt(T oScalar)
      Returns a boolean object representing the result of “greater” comparison of this scalar and a given scalar.
      Parameters:
      oScalar - an object with which this object is compared.
      Returns:
      a boolean object representing the result of “greater” comparison of this scalar and a given scalar
    • psyGe

      default PsyBoolean psyGe(T oScalar)
      Returns a boolean object representing the result of “greater or equal” comparison of this scalar and a given scalar.
      Parameters:
      oScalar - an object with which this object is compared.
      Returns:
      a boolean object representing the result of “greater or equal” comparison of this scalar and a given scalar
    • psyCmp

      default PsyInteger psyCmp(T oScalar)
      Compares this scalar against given scalar 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.
      Parameters:
      oScalar - an object with which this object is compared.
      Returns:
      a result of the comparison.
    • psyMin

      default PsyScalar<T> psyMin(T oScalar)
      Returns the minimum of this scalar and given scalar.
      Parameters:
      oScalar - the given scalar.
      Returns:
      the minimum of this scalar and given scalar
    • psyMax

      default PsyScalar<T> psyMax(T oScalar)
      Returns the maximum of this scalar and given scalar.
      Parameters:
      oScalar - the given scalar.
      Returns:
      the maximum of this scalar and given scalar