
JML  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.jmlspecs.samples.dbc.ComplexOps
An abstract class that holds all of the common algorithms for complex numbers. Note that this class knows about both of its subclasses Rectangular and Polar.
Constructor Summary  
ComplexOps()

Method Summary  
Complex 
add(Complex b)
Return this + b (the sum of this and b). 
Complex 
div(Complex b)
Return this/b (the quotient of this by b). 
boolean 
equals(Object o)
Return true if these are the same complex number. 
int 
hashCode()
Return a hashCode for this number. 
Complex 
mul(Complex b)
Tell whether the given angles are the same, taking into account that angles measured in radians wrap around after 2*StrictMath.PI times. 
Complex 
sub(Complex b)
Return this  b (the difference between this and b). 
Methods inherited from class java.lang.Object 
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait 
Methods inherited from interface org.jmlspecs.samples.dbc.Complex 
angle, imaginaryPart, magnitude, realPart 
Constructor Detail 
public ComplexOps()
Method Detail 
public Complex add(Complex b)
Complex
add
in interface Complex
public Complex sub(Complex b)
Complex
sub
in interface Complex
public Complex mul(Complex b)
Complex
mul
in interface Complex
public Complex div(Complex b)
Complex
div
in interface Complex
public boolean equals(Object o)
Complex
equals
in interface Complex
equals
in class Object
public int hashCode()
Complex
hashCode
in interface Complex
hashCode
in class Object

JML  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 