Class MatlabDouble


  • public final class MatlabDouble
    extends java.lang.Object
    MATLAB double with real and imaginary components.
    Since:
    4.2.0
    • Constructor Summary

      Constructors 
      Constructor Description
      MatlabDouble​(double real, double imag)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Returns true if and only if the other object is of the same class and its component real and imaginary parts are both equal.
      int hashCode()
      Returns a hash code compatible with equals(...).
      boolean isReal()
      Returns true if the imaginary value is equivalent to the default value for the numeric type, false otherwise.
      double toImaginary()
      Returns the imaginary value.
      double toReal()
      Returns the real value.
      java.lang.String toString()
      Returns a String representation of the number.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MatlabDouble

        public MatlabDouble​(double real,
                            double imag)
    • Method Detail

      • toReal

        public double toReal()
        Returns the real value.
        Returns:
      • toImaginary

        public double toImaginary()
        Returns the imaginary value.
        Returns:
      • isReal

        public boolean isReal()
        Returns true if the imaginary value is equivalent to the default value for the numeric type, false otherwise. Equivalent to the MATLAB isreal function.
        Returns:
      • toString

        public java.lang.String toString()
        Returns a String representation of the number. If the number is real the String representation is real. If an imaginary component is present, the format is real + imagi if the imaginary component is non-negative and real - imagi if the imaginary component is negative.
        Overrides:
        toString in class java.lang.Object
        Returns:
      • equals

        public boolean equals​(java.lang.Object obj)
        Returns true if and only if the other object is of the same class and its component real and imaginary parts are both equal. The definition of equality for the component parts is defined by the equals(...) method of the boxed numeric class of its components.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj -
        Returns:
      • hashCode

        public int hashCode()
        Returns a hash code compatible with equals(...).
        Overrides:
        hashCode in class java.lang.Object
        Returns: