Class RealInfinity

java.lang.Object
edu.udel.cis.vsl.sarl.number.real.RealNumber
edu.udel.cis.vsl.sarl.number.real.RealInfinity
All Implemented Interfaces:
Number, Comparable<Number>
Direct Known Subclasses:
RealIntegerInfinity, RealRationalInfinity

public abstract class RealInfinity extends RealNumber
An abstract class represents the infinite real number.
According to the data-type (integer/rational), it has two derived sub-class:
RealIntegerInfinity and RealRationalInfinity
  • Method Summary

    Modifier and Type
    Method
    Description
    The string representation used when this number appears inside of another expression.
    boolean
    Is this number infinite?
    boolean
    Is this number equal to 1?
    boolean
    Is this number equal to 0? Same as signum() == 0, but sometimes more convenient.
    int
    This is a numerical comparison, so the order is a numerical order based on the value of this and other.
    int
    Returns 0 if this number equals 0, -1 if this number is negative, 1 if this number is positive.
     

    Methods inherited from class edu.udel.cis.vsl.sarl.number.real.RealNumber

    compareTo

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • signum

      public int signum()
      Description copied from interface: Number
      Returns 0 if this number equals 0, -1 if this number is negative, 1 if this number is positive.
    • isZero

      public boolean isZero()
      Description copied from interface: Number
      Is this number equal to 0? Same as signum() == 0, but sometimes more convenient.
    • isOne

      public boolean isOne()
      Description copied from interface: Number
      Is this number equal to 1?
    • isInfinite

      public boolean isInfinite()
      Description copied from interface: Number
      Is this number infinite?
      Returns:
      true, if it is positive/negative infinity;
      false, if it is finite.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • atomString

      public String atomString()
      Description copied from interface: Number
      The string representation used when this number appears inside of another expression. For example if the number is 3/4, this method could return (3/4), because in the expression 10*(3/4) you really need the parentheses. On the other hand, if the representation is 0.75, the parens probably are not necessary, and this method might return the same thing as the toString() method.
    • numericalCompareTo

      public int numericalCompareTo(Number other)
      Description copied from interface: Number
      This is a numerical comparison, so the order is a numerical order based on the value of this and other.
      Parameters:
      other - a non-null Number with the same type with this.
      Returns:
      Returns a positive value if this is greater than other, 0 if this equals other, a negative value if this is less than other.