|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.hedgehog.types.HDouble
public class HDouble
Title: HDouble - wrapper around type double.
Description: Wrapper for double. Provides additional functionality, lacking in Double.
Copyright: Copyright (c) Hedgehog Software 2007-2009.
Company: Hedgehog Software
| Field Summary | |
|---|---|
static int |
MAX_EXPONENT
Maximum exponent a double may have; ie 1,023. |
static double |
MAX_VALUE
Maximum double value; ie // 1.8e+308. |
static int |
MIN_EXPONENT
Minimum exponent a double may have; ie -1022. |
static double |
MIN_VALUE
Minimum double value; ie 4.9e-324. |
static double |
NaN
Not-a-Number (NaN), equivalent to Double.longBitsToDouble(0x7ff8000000000000L). |
| Constructor Summary | |
|---|---|
HDouble()
Default constructor. |
|
HDouble(double d)
Constructor. |
|
HDouble(java.lang.Double d)
Constructor. |
|
HDouble(HDouble object)
Copy constructor. |
|
HDouble(java.lang.String d)
Constructor. |
|
| Method Summary | |
|---|---|
HDouble |
abs()
Returns the absolute value of this double value. |
static HDouble |
add(HDouble d1,
double d2)
Addition. |
static HDouble |
add(HDouble d1,
java.lang.Double d2)
Addition. |
static HDouble |
add(HDouble d1,
HDouble d2)
Addition. |
void |
addTo(double d)
Arithmetic addition. |
void |
addTo(java.lang.Double d)
Arithmetic addition. |
void |
addTo(HDouble d)
Arithmetic addition. |
HDouble |
ceil()
Returns the smallest value that is greater than or equal to this value and is equal to a mathematical integer. |
java.lang.Object |
clone()
Returns a clone of this object. |
int |
compare(java.lang.Object obj1,
java.lang.Object obj2)
Overrides the Comparator.compare() method |
int |
compareTo(HDouble obj)
Overrides the Comparable.compareTo() method |
HDouble |
cosine()
Returns the cosine of this value. |
void |
divide(double d)
Divides the value by the specified double d. |
void |
divide(java.lang.Double d)
Divides the value by the specified Double d. |
void |
divide(HDouble d)
Divides the value by the specified HDouble d. |
static HDouble |
divide(HDouble d1,
double d2)
Divides the HDouble d1 by double d2. |
static HDouble |
divide(HDouble d1,
java.lang.Double d2)
Divides the HDouble d1 by Double d2. |
static HDouble |
divide(HDouble d1,
HDouble d2)
Divides the HDouble d1 by HDouble d2. |
boolean |
equals(java.lang.Object obj)
Overrides the Comparator.equals() method. |
boolean |
equals(java.lang.Object obj,
double tolerance)
Compares the specified object with this object. |
HDouble |
exp()
Returns the exponential value of this value. |
void |
flipSign()
Flips the sign of this value. |
HDouble |
floor()
Returns the largest value that is less than or equal to the argument and is equal to a mathematical integer. |
double |
getValue()
Returns this object's value. |
boolean |
greaterThan(HDouble obj)
Tests whether or not this value is greater than the specified value. |
boolean |
greaterThanOrEqualTo(HDouble obj)
Tests whether or not this value is greater than or equal to the specified value. |
int |
hashCode()
Returns the hashcode of this HDouble object. |
HBoolean |
isNegative()
Tests whether or not this value is negative. |
HBoolean |
isPositive()
Tests whether or not this value is positive. |
HBoolean |
isZero(double tolerance)
Tests whether or not this value is zero. |
boolean |
lessThan(HDouble obj)
Tests whether or not this value is less than the specified value. |
boolean |
lessThanOrEqualTo(HDouble obj)
Tests whether or not this value is less than or equal to the specified value. |
HDouble |
log()
Returns the natural logarithm of this value. |
static HDouble |
multiply(HDouble d1,
double d2)
Multiplication. |
static HDouble |
multiply(HDouble d1,
java.lang.Double d2)
Multiplication. |
static HDouble |
multiply(HDouble d1,
HDouble d2)
Multiplication. |
void |
multiplyBy(double d)
Multiplies this value by the specified value. |
void |
multiplyBy(java.lang.Double d)
Multiplies this value by the specified value. |
void |
multiplyBy(HDouble d)
Multiplies this value by the specified value. |
boolean |
sameValue(HDouble object,
double tolerance)
Tests whether or not the specified object has the same value as this object, within the specified tolerance. |
void |
setValue(double newD)
Sets this object's value. |
void |
setValue(java.lang.Double newD)
Sets this object's value. |
void |
setValue(HDouble newD)
Sets this object's value. |
HDouble |
sine()
Returns the sine of this value. |
HDouble |
sqrt()
Returns the sine of this value. |
void |
subtract(double d)
Subtracts the specified scalar value from this value. |
void |
subtract(java.lang.Double d)
Subtracts the specified scalar value from this value. |
void |
subtract(HDouble d)
Subtracts the specified scalar value from this value. |
static HDouble |
subtract(HDouble d1,
double d2)
Subtraction. |
static HDouble |
subtract(HDouble d1,
java.lang.Double d2)
Subtraction. |
static HDouble |
subtract(HDouble d1,
HDouble d2)
Subtraction. |
HDouble |
tan()
Returns the tangent of this value. |
java.lang.Double |
toDouble()
Returns a Double equivalent of this object. |
java.lang.String |
toString()
Returns a String representation of a HDouble object. |
java.lang.String |
toStringFormat2()
Returns a formatted String representation of this HDouble object, formatting the number with two decimal places. |
java.lang.String |
toStringFormat3()
Returns a formatted String representation of this HDouble object, formatting the number with three decimal places. |
java.lang.String |
toStringFormat4()
Returns a formatted String representation of this HDouble object, formatting the number with four decimal places. |
java.lang.String |
toStringFormatE2()
Returns a formatted String representation of this HDouble object, formatting the number with two decimal places using scientific notation. |
java.lang.String |
toStringFormatE3()
Returns a formatted String representation of this HDouble object, formatting the number with three decimal places using scientific notation. |
java.lang.String |
toStringFormatE4()
Returns a formatted String representation of this HDouble object, formatting the number with four decimal places using scientific notation. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final double MIN_VALUE
public static final double MAX_VALUE
public static final int MAX_EXPONENT
public static final int MIN_EXPONENT
public static final double NaN
Double.longBitsToDouble(0x7ff8000000000000L).
| Constructor Detail |
|---|
public HDouble()
public HDouble(double d)
d - Value of type double.public HDouble(java.lang.Double d)
d - Value of type Double.public HDouble(java.lang.String d)
d - Value of type String.public HDouble(HDouble object)
object - Object to copy.| Method Detail |
|---|
public HDouble abs()
public void addTo(double d)
d - double number to add.public void addTo(HDouble d)
d - HDouble number to add.public void addTo(java.lang.Double d)
d - Double number to add.
public static HDouble add(HDouble d1,
HDouble d2)
d1 - First HDouble operand.d2 - Second HDouble operand.
public static HDouble add(HDouble d1,
java.lang.Double d2)
d1 - First HDouble operand.d2 - Second Double operand.
public static HDouble add(HDouble d1,
double d2)
d1 - First HDouble operand.d2 - Second double operand.
public java.lang.Object clone()
clone in class java.lang.Objectpublic HDouble ceil()
public HDouble floor()
public void flipSign()
public int compare(java.lang.Object obj1,
java.lang.Object obj2)
compare in interface java.util.Comparatorobj1 - Object 1.obj2 - Object 2.
public int compareTo(HDouble obj)
compareTo in interface java.lang.Comparable<HDouble>obj - Object to compare against this object.
public boolean lessThan(HDouble obj)
obj - Object to compare.
public boolean greaterThan(HDouble obj)
obj - Object to compare.
public boolean lessThanOrEqualTo(HDouble obj)
obj - Object to compare.
public boolean greaterThanOrEqualTo(HDouble obj)
obj - Object to compare.
public HDouble cosine()
public boolean equals(java.lang.Object obj,
double tolerance)
obj - Object to compare with invoking object.tolerance - Required tolerance.
public boolean equals(java.lang.Object obj)
equals in interface java.util.Comparatorequals in class java.lang.Objectobj - Object to compare with invoking object.
public int hashCode()
hashCode in class java.lang.Objectpublic HDouble exp()
public void divide(double d)
d - Divisor.public void divide(HDouble d)
d - Divisor.public void divide(java.lang.Double d)
d - Divisor.
public static HDouble divide(HDouble d1,
HDouble d2)
d1 - Numerator.d2 - Denomanator.
public static HDouble divide(HDouble d1,
double d2)
d1 - Numerator.d2 - Denomanator.
public static HDouble divide(HDouble d1,
java.lang.Double d2)
d1 - Numerator.d2 - Denomanator.
public double getValue()
public HBoolean isPositive()
public HBoolean isNegative()
public HBoolean isZero(double tolerance)
tolerance - Required tolerance.
public HDouble log()
public void multiplyBy(double d)
d - Scalar floaitng-point value.public void multiplyBy(HDouble d)
d - HDouble object.public void multiplyBy(java.lang.Double d)
d - Java Double object.
public static HDouble multiply(HDouble d1,
HDouble d2)
d1 - First HDouble operand.d2 - Second HDouble operand.
public static HDouble multiply(HDouble d1,
java.lang.Double d2)
d1 - First HDouble operand.d2 - Second Double operand.
public static HDouble multiply(HDouble d1,
double d2)
d1 - First HDouble operand.d2 - Second double operand.
public boolean sameValue(HDouble object,
double tolerance)
object - Object to compare.tolerance - Required tolerance.
public void setValue(double newD)
newD - New value.public void setValue(HDouble newD)
newD - New value.public void setValue(java.lang.Double newD)
newD - New value.public HDouble sine()
public HDouble sqrt()
public void subtract(double d)
d - Value to subtract.public void subtract(HDouble d)
d - Value to subtract.public void subtract(java.lang.Double d)
d - Value to subtract.
public static HDouble subtract(HDouble d1,
HDouble d2)
d1 - First HDouble operand.d2 - Second HDouble operand.
public static HDouble subtract(HDouble d1,
java.lang.Double d2)
d1 - First HDouble operand.d2 - Second Double operand.
public static HDouble subtract(HDouble d1,
double d2)
d1 - First HDouble operand.d2 - Second double operand.
public HDouble tan()
public java.lang.Double toDouble()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toStringFormat2()
public java.lang.String toStringFormat3()
public java.lang.String toStringFormat4()
public java.lang.String toStringFormatE2()
public java.lang.String toStringFormatE3()
public java.lang.String toStringFormatE4()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||