dspl.intermediate.variable.primitive
Class Complex

java.lang.Object
  extended by dspl.intermediate.variable.primitive.Complex

public class Complex
extends java.lang.Object

Complex is the primitive object wrapper for Complex #'s In DSPL, all other primitive atomic objects (float, int, byte, etc) already have equivalent java classes that can be substitued in the Variable's valueOf field. The one exception is the complex type, thus the raison-d'etre for the Complex class.

Author:
David

Field Summary
 float imag
          The imaginary part of the complex number
 float real
          The real part of the complex number
 
Constructor Summary
Complex(float real, float imag)
           
Complex(java.lang.String real, java.lang.String imag)
          Constructor used to create based on string representationso of the imaginary and real parts of the complex number.
 
Method Summary
 java.lang.String toString()
          Returns a string representation of the complex number in the form of "a + bi" or "a - bi" depending on the sign of imag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

real

public float real
The real part of the complex number


imag

public float imag
The imaginary part of the complex number

Constructor Detail

Complex

public Complex(float real,
               float imag)
Parameters:
real - Real part of the complex #
imag - Imag part of the complex #

Complex

public Complex(java.lang.String real,
               java.lang.String imag)
Constructor used to create based on string representationso of the imaginary and real parts of the complex number.

Parameters:
real -
imag -
Method Detail

toString

public java.lang.String toString()
Returns a string representation of the complex number in the form of "a + bi" or "a - bi" depending on the sign of imag

Overrides:
toString in class java.lang.Object