Package matlabcontrol.link
Class MatlabSingle
- java.lang.Object
-
- matlabcontrol.link.MatlabSingle
-
public final class MatlabSingle extends java.lang.ObjectMATLABsinglewith real and imaginary components.- Since:
- 4.2.0
-
-
Constructor Summary
Constructors Constructor Description MatlabSingle(float real, float imag)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Returnstrueif and only if the other object is of the same class and its component real and imaginary parts are both equal.inthashCode()Returns a hash code compatible withequals(...).booleanisReal()Returnstrueif the imaginary value is equivalent to the default value for the numeric type,falseotherwise.floattoImaginary()Returns the imaginary value.floattoReal()Returns the real value.java.lang.StringtoString()Returns aStringrepresentation of the number.
-
-
-
Method Detail
-
toReal
public float toReal()
Returns the real value.- Returns:
-
toImaginary
public float toImaginary()
Returns the imaginary value.- Returns:
-
isReal
public boolean isReal()
Returnstrueif the imaginary value is equivalent to the default value for the numeric type,falseotherwise. Equivalent to the MATLABisrealfunction.- Returns:
-
toString
public java.lang.String toString()
Returns aStringrepresentation of the number. If the number is real the String representation is real. If an imaginary component is present, the format isreal + imagiif the imaginary component is non-negative andreal - imagiif the imaginary component is negative.- Overrides:
toStringin classjava.lang.Object- Returns:
-
equals
public boolean equals(java.lang.Object obj)
Returnstrueif 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 theequals(...)method of the boxed numeric class of its components.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj-- Returns:
-
hashCode
public int hashCode()
Returns a hash code compatible withequals(...).- Overrides:
hashCodein classjava.lang.Object- Returns:
-
-