Class PseudoReal

  • All Implemented Interfaces:
    IVilType
    Direct Known Subclasses:
    PseudoInteger

    public class PseudoReal
    extends java.lang.Object
    implements IVilType
    Implements a pseudo class for reals.
    Author:
    Holger Eichelberger
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.Double DEFAULT  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PseudoReal()
      Prevents external instantiation.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double abs​(double r0)
      Returns the absolute value of the given real value.
      static double add​(double r1, double r2)
      Represents the addition for reals.
      static int ceil​(double r0)
      Returns the integer that is closest to r0.
      static double division​(double r1, double r2)
      Represents the division for reals.
      static boolean equals​(double r1, double r2)
      Represents the equality operation for Reals.
      static int floor​(double r0)
      Returns the largest integer that is less than or equal to r0.
      static TypeDescriptor<?> getType​(java.lang.Double value)
      Returns the type of value.
      static boolean greaterEqualThen​(double r1, double r2)
      Represents the greater-then-equals comparison for reals.
      static boolean greaterThan​(double r1, double r2)
      Represents the greater comparison for reals.
      static boolean isFinite​(double r0)
      Returns whether the given real value is finite.
      static boolean isInfinite​(double r0)
      Returns whether the given real value is infinite.
      static boolean isNaN​(double r0)
      Returns whether the given real value is not a number.
      static boolean lessEqualThen​(double r1, double r2)
      Represents the less-then-equals comparison for reals.
      static boolean lessThan​(double r1, double r2)
      Represents the less-than comparison for reals.
      static double max​(double r1, double r2)
      Returns the maximum value of r1 and r2.
      static double min​(double r1, double r2)
      Returns the minimum value of r1 and r2.
      static double multiplication​(double r1, double r2)
      Represents the multiplication for reals.
      static double negates​(double r0)
      Negates the given real value.
      static double subtract​(double r1, double r2)
      Represents the subtraction for reals.
      static java.lang.String toString​(double r0)
      Returns the string value of r0.
      static boolean unequals​(double r1, double r2)
      Represents the unequality operation for Reals.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT

        public static final java.lang.Double DEFAULT
    • Constructor Detail

      • PseudoReal

        protected PseudoReal()
        Prevents external instantiation.
    • Method Detail

      • add

        public static double add​(double r1,
                                 double r2)
        Represents the addition for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 + r2
      • subtract

        public static double subtract​(double r1,
                                      double r2)
        Represents the subtraction for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 - r2
      • multiplication

        public static double multiplication​(double r1,
                                            double r2)
        Represents the multiplication for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 * r2
      • division

        public static double division​(double r1,
                                      double r2)
        Represents the division for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 / r2
      • lessThan

        public static boolean lessThan​(double r1,
                                       double r2)
        Represents the less-than comparison for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 < r2
      • lessEqualThen

        public static boolean lessEqualThen​(double r1,
                                            double r2)
        Represents the less-then-equals comparison for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 <= r2
      • greaterEqualThen

        public static boolean greaterEqualThen​(double r1,
                                               double r2)
        Represents the greater-then-equals comparison for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 >= r2
      • greaterThan

        public static boolean greaterThan​(double r1,
                                          double r2)
        Represents the greater comparison for reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 >= r2
      • equals

        public static boolean equals​(double r1,
                                     double r2)
        Represents the equality operation for Reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 == r2
      • unequals

        public static boolean unequals​(double r1,
                                       double r2)
        Represents the unequality operation for Reals.
        Parameters:
        r1 - the first real to be considered
        r2 - the second real to be considered
        Returns:
        r1 != r2
      • negates

        public static double negates​(double r0)
        Negates the given real value.
        Parameters:
        r0 - the real to be negated
        Returns:
        -r0
      • abs

        public static double abs​(double r0)
        Returns the absolute value of the given real value.
        Parameters:
        r0 - the real the absolute value shall be returned for
        Returns:
        |r0|
      • isNaN

        public static boolean isNaN​(double r0)
        Returns whether the given real value is not a number.
        Parameters:
        r0 - the real the absolute value to be considered
        Returns:
        true if r0 is not a number, false else
      • isFinite

        public static boolean isFinite​(double r0)
        Returns whether the given real value is finite.
        Parameters:
        r0 - the real the absolute value to be considered
        Returns:
        true if r0 is finite, false else
      • isInfinite

        public static boolean isInfinite​(double r0)
        Returns whether the given real value is infinite.
        Parameters:
        r0 - the real the absolute value to be considered
        Returns:
        true if r0 is infinite, false else
      • floor

        public static int floor​(double r0)
        Returns the largest integer that is less than or equal to r0.
        Parameters:
        r0 - the real value to be considered
        Returns:
        floor(r0)
      • ceil

        public static int ceil​(double r0)
        Returns the integer that is closest to r0.
        Parameters:
        r0 - the real value to be considered
        Returns:
        ceil(r0)
      • min

        public static double min​(double r1,
                                 double r2)
        Returns the minimum value of r1 and r2.
        Parameters:
        r1 - the first value to be considered
        r2 - the first value to be considered
        Returns:
        min(r1, r2)
      • max

        public static double max​(double r1,
                                 double r2)
        Returns the maximum value of r1 and r2.
        Parameters:
        r1 - the first value to be considered
        r2 - the first value to be considered
        Returns:
        max(r1, r2)
      • toString

        public static java.lang.String toString​(double r0)
        Returns the string value of r0.
        Parameters:
        r0 - the real to be turned into a string
        Returns:
        the string value
      • getType

        public static TypeDescriptor<?> getType​(java.lang.Double value)
        Returns the type of value. "Overrides" PseudoAny.getType(Object).
        Parameters:
        value - the Real to return the type for
        Returns:
        the type of object (null if ob is null)