|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectMyDouble
public class MyDouble
MyDouble objects represent floating point values.
| Constructor Summary | |
|---|---|
MyDouble(double d)
Initializes the new MyDouble object so that it represents the value of the parameter. |
|
MyDouble(MyDouble m)
Copy Constructor. |
|
| Method Summary | |
|---|---|
MyDouble |
abs()
Returns the absolute value of the current object. |
MyDouble |
add(MyDouble x)
Returns the sum of the current object and the parameter. |
int |
compareTo(MyDouble x)
Compares the current object to the parameter. |
MyDouble |
divide(MyDouble x)
Returns the quotient obtained when dividing the current object by the parameter. |
boolean |
equals(MyDouble x)
Checks if the current object is equal to the parameter. |
MyDouble |
multiply(MyDouble x)
Returns the product of the current object and the parameter. |
MyDouble |
sqrt()
Returns a MyDouble representing the square root of the current object. |
MyDouble |
subtract(MyDouble x)
Returns the difference obtained by subtracting the parameter from the current object. |
java.lang.String |
toString()
YOU MAY NOT CALL THIS METHOD EXCEPT WHILE YOU ARE IMPLEMENTING THE toString METHOD OF THE COMPLEX NUMBER CLASS!! Returns a String representation of the current object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MyDouble(double d)
d - value to be "wrapped" in the objectpublic MyDouble(MyDouble m)
m - existing MyDouble object that is being copied| Method Detail |
|---|
public MyDouble add(MyDouble x)
x - the value that serves as the second operand for the addition
public MyDouble subtract(MyDouble x)
x - the value to be subtracted
public MyDouble multiply(MyDouble x)
x - the value that serves as the second operand for the multiplication
public MyDouble divide(MyDouble x)
x - the value that serves as the divisor
public MyDouble sqrt()
public int compareTo(MyDouble x)
x - the object being compared with the current object
public boolean equals(MyDouble x)
x - the object being compared for equality with the current object
public MyDouble abs()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||