ewe.sys
Class Double

java.lang.Object
  extended byewe.data.DataObject
      extended byewe.sys.Double
All Implemented Interfaces:
Comparable, Copyable, DataUnit, Stringable, Value

public class Double
extends DataObject
implements Value


Field Summary
static int AT_LEAST_ONE_DECIMAL
          Option for toString().
static Double d1
          Convenience temporary variable.
static Double d2
          Convenience temporary variable.
static Double d3
          Convenience temporary variable.
 int decimalPlaces
          This sets the default number of decimal places for this Double when a toString() is done.
static int EXP_NOTATION
          Option for toString().
static int FREE_DECIMAL
          Option for toString().
static int INFINITY
           
static int NAN
           
static int NEGATIVE
           
static int NEGATIVE_INFINITY
           
static int NO_EXP_NOTATION
          Option for toString().
static int POSITIVE
           
static int POSITIVE_INFINITY
           
static int TRUNCATE
          Option for toString().
static int VALID
           
 double value
           
static int ZERO
           
static int ZERO_FILL
          Option for toString().
 
Constructor Summary
Double()
           
 
Method Summary
 int compareTo(Object other)
          Compare this object with another.
 void copyFrom(Object other)
          This stores the bit-wise representation of the double in the Long value.
 Double fromJavaWrapper(Object javaWrapper)
          Place the value in the standard java Wrapper (e.g.
 void fromString(String value)
           
 boolean is(int special)
          This checks to see if the value of the double is one of the special values (POSITIVE_INFINITY, NEGATIVE_INFINITY, INFINITY(either), NAN) or if it is NEGATIVE, POSITIVE or ZERO.
static boolean isValid(double value)
          Returns true if the number is NOT NaN and is NOT an INFINITY value.
static void matrixFunction(double[] doubleMatrix, int startIndex, int rows, int columns, MathFunction[] functions, double[] destDoubleArray, int destStartIndex)
          Load the values in the array as bit values from the source byte array.
 Double set(double d)
           
 Double set(Double d)
           
 Double setSpecial(int special)
          This sets the double to one of the following values: POSITIVE_INFINITY(same as INFINITY), NEGATIVE_INFINITY NAN, NEGATIVE (-1), POSITIVE (+1), ZERO.
 String toString()
          Return a String representation of this object.
 String toString(int length, int decimalLength, int options)
          This prints out the value in a particular format.
 
Methods inherited from class ewe.data.DataObject
_getSetField, appendAllFields, copied, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode
 

Field Detail

value

public double value

decimalPlaces

public int decimalPlaces
This sets the default number of decimal places for this Double when a toString() is done.


d1

public static final Double d1
Convenience temporary variable.


d2

public static final Double d2
Convenience temporary variable.


d3

public static final Double d3
Convenience temporary variable.


ZERO_FILL

public static final int ZERO_FILL
Option for toString().

See Also:
Constant Field Values

TRUNCATE

public static final int TRUNCATE
Option for toString().

See Also:
Constant Field Values

FREE_DECIMAL

public static final int FREE_DECIMAL
Option for toString().

See Also:
Constant Field Values

EXP_NOTATION

public static final int EXP_NOTATION
Option for toString().

See Also:
Constant Field Values

NO_EXP_NOTATION

public static final int NO_EXP_NOTATION
Option for toString().

See Also:
Constant Field Values

AT_LEAST_ONE_DECIMAL

public static final int AT_LEAST_ONE_DECIMAL
Option for toString().

See Also:
Constant Field Values

NEGATIVE

public static final int NEGATIVE
See Also:
Constant Field Values

POSITIVE

public static final int POSITIVE
See Also:
Constant Field Values

ZERO

public static final int ZERO
See Also:
Constant Field Values

POSITIVE_INFINITY

public static final int POSITIVE_INFINITY
See Also:
Constant Field Values

NEGATIVE_INFINITY

public static final int NEGATIVE_INFINITY
See Also:
Constant Field Values

INFINITY

public static final int INFINITY
See Also:
Constant Field Values

NAN

public static final int NAN
See Also:
Constant Field Values

VALID

public static final int VALID
See Also:
Constant Field Values
Constructor Detail

Double

public Double()
Method Detail

set

public Double set(double d)

set

public Double set(Double d)

toString

public String toString(int length,
                       int decimalLength,
                       int options)
This prints out the value in a particular format.

Parameters:
length - The total length of the output string. Set this to zero to specify no maximum length constraint.
decimalLength - the number of decimal places to output. If FREE_DECIMAL is specified as an option, then this will specify the MAXIMUM number of decimal digits to display - it may actually display less. If FREE_DECIMAL is specified AND decimal places is zero, then the VM will decide how many decimal places to display.
options - Must be the bitwise ORing of:
ZERO_FILL - Pad with leading Zeros to the specified length.
TRUNCATE - Truncate any digits after the maximum decimal digits (by default it will round up).
FREE_DECIMAL - Actual number of decimals output depend on the value of decimalLength and the number of significant decimal digits.
EXP_NOTATION - Specify that Exp. notation MUST be used.
NO_EXP_NOTATION - Specify that Exp. notation MUST NOT be used.
AT_LEAST_ONE_DECIMAL - Specify that at least one decimal place must be shown.
Returns:
A string representation of the double value.

toString

public String toString()
Description copied from class: Object
Return a String representation of this object.

Specified by:
toString in interface Stringable
Overrides:
toString in class Object
Returns:
a String representing this object.

fromString

public void fromString(String value)
Specified by:
fromString in interface Stringable

compareTo

public int compareTo(Object other)
Description copied from interface: Comparable
Compare this object with another. It should return: less than 0 if this object is considered LESS than the "other" object; greater than 0 if this object is considered GREATER than the "other" object; 0 if this object is considered EQUAL to the "other" object. (i.e. it is an implicit subtraction).

Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class DataObject

isValid

public static boolean isValid(double value)
Returns true if the number is NOT NaN and is NOT an INFINITY value.


is

public boolean is(int special)
This checks to see if the value of the double is one of the special values (POSITIVE_INFINITY, NEGATIVE_INFINITY, INFINITY(either), NAN) or if it is NEGATIVE, POSITIVE or ZERO.


setSpecial

public Double setSpecial(int special)
This sets the double to one of the following values: POSITIVE_INFINITY(same as INFINITY), NEGATIVE_INFINITY NAN, NEGATIVE (-1), POSITIVE (+1), ZERO.


matrixFunction

public static void matrixFunction(double[] doubleMatrix,
                                  int startIndex,
                                  int rows,
                                  int columns,
                                  MathFunction[] functions,
                                  double[] destDoubleArray,
                                  int destStartIndex)
Load the values in the array as bit values from the source byte array.


copyFrom

public void copyFrom(Object other)
This stores the bit-wise representation of the double in the Long value. If dest is null a new Long will be created. The return value is the Long with the bit-wise representation stored within it.

Specified by:
copyFrom in interface DataUnit
Overrides:
copyFrom in class DataObject

fromJavaWrapper

public Double fromJavaWrapper(Object javaWrapper)
                       throws IllegalArgumentException
Place the value in the standard java Wrapper (e.g. java.lang.Double, java.lang.Float, etc) into this ewe.sys.Double. The Character and Boolean values may not be converted to double.

Parameters:
javaWrapper - one of the java.lang primitive wrapper values representing a value that may be converted into a double value.
Returns:
this ewe.sys.Double after the value has been placed in it.
Throws:
IllegalArgumentException - if the javaWrapper parameter is one of the illegal types.