ru.tunegov.mathematic
Class Decimal

java.lang.Object
  |
  +--java.lang.Number
        |
        +--ru.tunegov.mathematic.Decimal
All Implemented Interfaces:
java.lang.Cloneable, ElementSet, java.io.Serializable

public class Decimal
extends java.lang.Number
implements ElementSet

This is a non-visual component that represents decimal number. The given class realizes main operations above decimal numbers.

Since:
Mathematic 1.0
See Also:
Serialized Form

Field Summary
static Decimal E
          Constant that represents exponential
static Decimal PI
          Constant that represents Pi
 
Constructor Summary
Decimal()
          Construct a Decimal object.
Decimal(double value)
          Construct a Decimal object.
Decimal(java.lang.String s)
          Construct a Decimal object.
 
Method Summary
 ElementSet abs()
          Returns the absolute value of an element of a set.
 ElementSet add(Complex arg)
          Returns the sum of the given element with argument (result = this + arg).
 ElementSet add(Decimal arg)
          Returns the sum of the given element with argument (result = this + arg).
 ElementSet add(double arg)
          Returns the sum of the given element with argument (result = this + arg).
 ElementSet add(ElementSet arg)
          Returns the sum of the given element with argument (result = this + arg).
 MatrixElementSet add(MatrixElementSet arg)
          Returns the sum of the given element with argument (result = this + arg).
 java.lang.Object clone()
          Return clone of this object.
 ElementSet cos()
          Returns the cosine of given element.
 ElementSet divide(Complex arg)
          Returns the quotient of the given element with argument (result = this / arg).
 ElementSet divide(Decimal arg)
          Returns the quotient of the given element with argument (result = this / arg).
 ElementSet divide(double arg)
          Returns the quotient of the given element with argument (result = this / arg).
 ElementSet divide(ElementSet arg)
          Returns the quotient of the given element with argument (result = this / arg).
 MatrixElementSet divide(MatrixElementSet arg)
          Returns the quotient of the given element with argument (result = this / arg).
 ElementSet divideInverse(Complex arg)
          Returns the quotient of the argument with given element (result = arg / this).
 ElementSet divideInverse(Decimal arg)
          Returns the quotient of the argument with given element (result = arg / this).
 ElementSet divideInverse(double arg)
          Returns the quotient of the argument with given element (result = arg / this).
 MatrixElementSet divideInverse(MatrixElementSet arg)
          Returns the quotient of the argument with given element (result = arg / this).
 double doubleValue()
          Returns the value of the specified number as a double.
 boolean equals(java.lang.Object obj)
          Compares two Objects for equality.
 ElementSet exp()
          Returns the exponential function raised in a degree equal to the given element.
 float floatValue()
          Returns the value of the specified number as a float.
 double getValue()
          Returns the value of a decimal number.
 int intValue()
          Returns the value of the specified number as a int.
 ElementSet inverse()
          Returns the inverse value of the given element.
 ElementSet log()
          Returns the logarithm of given element.
 long longValue()
          Returns the value of the specified number as a long.
 ElementSet multiply(Complex arg)
          Returns the product of the given element with argument (result = this * arg).
 ElementSet multiply(Decimal arg)
          Returns the product of the given element with argument (result = this * arg).
 ElementSet multiply(double arg)
          Returns the product of the given element with argument (result = this * arg).
 ElementSet multiply(ElementSet arg)
          Returns the product of the given element with argument (result = this * arg).
 MatrixElementSet multiply(MatrixElementSet arg)
          Returns the product of the given element with argument (result = this * arg).
 ElementSet negate()
          Returns the element negative given.
 ElementSet pow(double degree)
          Returns the given element raised to n-th degree.
 ElementSet root(int degree)
          Returns the root of n-th degree of given element.
 void setValue(double value)
          Sets the value of a decimal number.
 ElementSet sin()
          Returns the sine of given element.
 ElementSet sqrt()
          Returns the square root of given element.
 ElementSet subtract(Complex arg)
          Returns the difference of the given element with argument (result = this - arg).
 ElementSet subtract(Decimal arg)
          Returns the difference of the given element with argument (result = this - arg).
 ElementSet subtract(double arg)
          Returns the difference of the given element with argument (result = this - arg).
 ElementSet subtract(ElementSet arg)
          Returns the difference of the given element with argument (result = this - arg).
 MatrixElementSet subtract(MatrixElementSet arg)
          Returns the difference of the given element with argument (result = this - arg).
 ElementSet subtractInverse(Complex arg)
          Returns the difference of the argument with given element (result = arg - this).
 ElementSet subtractInverse(Decimal arg)
          Returns the difference of the argument with given element (result = arg - this).
 ElementSet subtractInverse(double arg)
          Returns the difference of the argument with given element (result = arg - this).
 MatrixElementSet subtractInverse(MatrixElementSet arg)
          Returns the difference of the argument with given element (result = arg - this).
 ElementSet tan()
          Returns the tangent of given element.
 java.lang.String toFormattedString(java.text.DecimalFormat df)
          Returns formatted string representing the given element.
 java.lang.String toString()
          Returns a String that represents the value of this object.
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PI

public static final Decimal PI
Constant that represents Pi

E

public static final Decimal E
Constant that represents exponential
Constructor Detail

Decimal

public Decimal()
Construct a Decimal object.

Decimal

public Decimal(double value)
Construct a Decimal object.
Parameters:
value - value of decimal number

Decimal

public Decimal(java.lang.String s)
Construct a Decimal object.
Parameters:
s - The string representation of decimal number
Method Detail

abs

public ElementSet abs()
Returns the absolute value of an element of a set.
Specified by:
abs in interface ElementSet
Returns:
The absolute value of an element of a set

add

public ElementSet add(double arg)
Returns the sum of the given element with argument (result = this + arg).
Specified by:
add in interface ElementSet
Parameters:
arg - The second argument
Returns:
The sum of the given element with argument

add

public ElementSet add(Complex arg)
Returns the sum of the given element with argument (result = this + arg).
Specified by:
add in interface ElementSet
Parameters:
arg - The second argument
Returns:
The sum of the given element with argument

add

public ElementSet add(Decimal arg)
Returns the sum of the given element with argument (result = this + arg).
Specified by:
add in interface ElementSet
Parameters:
arg - The second argument
Returns:
The sum of the given element with argument

add

public ElementSet add(ElementSet arg)
Returns the sum of the given element with argument (result = this + arg).
Specified by:
add in interface ElementSet
Parameters:
arg - The second argument
Returns:
The sum of the given element with argument

add

public MatrixElementSet add(MatrixElementSet arg)
Returns the sum of the given element with argument (result = this + arg).
Specified by:
add in interface ElementSet
Parameters:
arg - The second argument
Returns:
The sum of the given element with argument

clone

public java.lang.Object clone()
Return clone of this object.
Specified by:
clone in interface ElementSet
Returns:
The clone of this object

cos

public ElementSet cos()
Returns the cosine of given element.
Specified by:
cos in interface ElementSet
Returns:
The cosine of the given element

divide

public ElementSet divide(double arg)
Returns the quotient of the given element with argument (result = this / arg).
Specified by:
divide in interface ElementSet
Parameters:
arg - The second argument
Returns:
The quotient of the given element with argument

divide

public ElementSet divide(Complex arg)
Returns the quotient of the given element with argument (result = this / arg).
Specified by:
divide in interface ElementSet
Parameters:
arg - The second argument
Returns:
The quotient of the given element with argument

divide

public ElementSet divide(Decimal arg)
Returns the quotient of the given element with argument (result = this / arg).
Specified by:
divide in interface ElementSet
Parameters:
arg - The second argument
Returns:
The quotient of the given element with argument

divide

public ElementSet divide(ElementSet arg)
Returns the quotient of the given element with argument (result = this / arg).
Specified by:
divide in interface ElementSet
Parameters:
arg - The second argument
Returns:
The quotient of the given element with argument

divide

public MatrixElementSet divide(MatrixElementSet arg)
Returns the quotient of the given element with argument (result = this / arg).
Specified by:
divide in interface ElementSet
Parameters:
arg - The second argument
Returns:
The quotient of the given element with argument

divideInverse

public ElementSet divideInverse(double arg)
Returns the quotient of the argument with given element (result = arg / this).
Specified by:
divideInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The quotient of the argument with given element

divideInverse

public ElementSet divideInverse(Complex arg)
Returns the quotient of the argument with given element (result = arg / this).
Specified by:
divideInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The quotient of the argument with given element

divideInverse

public ElementSet divideInverse(Decimal arg)
Returns the quotient of the argument with given element (result = arg / this).
Specified by:
divideInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The quotient of the argument with given element

divideInverse

public MatrixElementSet divideInverse(MatrixElementSet arg)
Returns the quotient of the argument with given element (result = arg / this).
Specified by:
divideInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The quotient of the argument with given element

doubleValue

public double doubleValue()
Returns the value of the specified number as a double. This may involve rounding.
Overrides:
doubleValue in class java.lang.Number
Returns:
the numeric value represented by this object after conversion to type double.

equals

public boolean equals(java.lang.Object obj)
Compares two Objects for equality.
Overrides:
equals in class java.lang.Object
Parameters:
obj - The reference object with which to compare
Returns:
true if this object is the same as the obj argument; false otherwise.

exp

public ElementSet exp()
Returns the exponential function raised in a degree equal to the given element.
Specified by:
exp in interface ElementSet
Returns:
The exponential function raised in a degree equal to the given element.

floatValue

public float floatValue()
Returns the value of the specified number as a float. This may involve rounding.
Overrides:
floatValue in class java.lang.Number
Returns:
the numeric value represented by this object after conversion to type float.

getValue

public double getValue()
Returns the value of a decimal number.
Returns:
The value of a decimal number

intValue

public int intValue()
Returns the value of the specified number as a int. This may involve rounding.
Overrides:
intValue in class java.lang.Number
Returns:
the numeric value represented by this object after conversion to type int.

inverse

public ElementSet inverse()
Returns the inverse value of the given element.
Specified by:
inverse in interface ElementSet
Returns:
The inverse value of the given element

log

public ElementSet log()
Returns the logarithm of given element.
Specified by:
log in interface ElementSet
Returns:
The logarithm of the given element

longValue

public long longValue()
Returns the value of the specified number as a long. This may involve rounding.
Overrides:
longValue in class java.lang.Number
Returns:
the numeric value represented by this object after conversion to type long.

multiply

public ElementSet multiply(double arg)
Returns the product of the given element with argument (result = this * arg).
Specified by:
multiply in interface ElementSet
Parameters:
arg - The second argument
Returns:
The product of the given element with argument

multiply

public ElementSet multiply(Complex arg)
Returns the product of the given element with argument (result = this * arg).
Specified by:
multiply in interface ElementSet
Parameters:
arg - The second argument
Returns:
The product of the given element with argument

multiply

public ElementSet multiply(Decimal arg)
Returns the product of the given element with argument (result = this * arg).
Specified by:
multiply in interface ElementSet
Parameters:
arg - The second argument
Returns:
The product of the given element with argument

multiply

public ElementSet multiply(ElementSet arg)
Returns the product of the given element with argument (result = this * arg).
Specified by:
multiply in interface ElementSet
Parameters:
arg - The second argument
Returns:
The product of the given element with argument

multiply

public MatrixElementSet multiply(MatrixElementSet arg)
Returns the product of the given element with argument (result = this * arg).
Specified by:
multiply in interface ElementSet
Parameters:
arg - The second argument
Returns:
The product of the given element with argument

negate

public ElementSet negate()
Returns the element negative given.
Specified by:
negate in interface ElementSet
Returns:
The element negative given

pow

public ElementSet pow(double degree)
Returns the given element raised to n-th degree.
Specified by:
pow in interface ElementSet
Parameters:
degree - The degree of power
Returns:
The given element raised to n-th degree

root

public ElementSet root(int degree)
Returns the root of n-th degree of given element.
Specified by:
root in interface ElementSet
Parameters:
degree - The degree of root
Returns:
The root of n-th degree of the given element

setValue

public void setValue(double value)
Sets the value of a decimal number.
Parameters:
value - The new value of a decimal number

sin

public ElementSet sin()
Returns the sine of given element.
Specified by:
sin in interface ElementSet
Returns:
The sine of the given element

sqrt

public ElementSet sqrt()
Returns the square root of given element.
Specified by:
sqrt in interface ElementSet
Returns:
The square root of the given element

subtract

public ElementSet subtract(double arg)
Returns the difference of the given element with argument (result = this - arg).
Specified by:
subtract in interface ElementSet
Parameters:
arg - The second argument
Returns:
The difference of the given element with argument

subtract

public ElementSet subtract(Complex arg)
Returns the difference of the given element with argument (result = this - arg).
Specified by:
subtract in interface ElementSet
Parameters:
arg - The second argument
Returns:
The difference of the given element with argument

subtract

public ElementSet subtract(Decimal arg)
Returns the difference of the given element with argument (result = this - arg).
Specified by:
subtract in interface ElementSet
Parameters:
arg - The second argument
Returns:
The difference of the given element with argument

subtract

public ElementSet subtract(ElementSet arg)
Returns the difference of the given element with argument (result = this - arg).
Specified by:
subtract in interface ElementSet
Parameters:
arg - The second argument
Returns:
The difference of the given element with argument

subtract

public MatrixElementSet subtract(MatrixElementSet arg)
Returns the difference of the given element with argument (result = this - arg).
Specified by:
subtract in interface ElementSet
Parameters:
arg - The second argument
Returns:
The difference of the given element with argument

subtractInverse

public ElementSet subtractInverse(double arg)
Returns the difference of the argument with given element (result = arg - this).
Specified by:
subtractInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The difference of the argument with given element

subtractInverse

public ElementSet subtractInverse(Complex arg)
Returns the difference of the argument with given element (result = arg - this).
Specified by:
subtractInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The difference of the argument with given element

subtractInverse

public ElementSet subtractInverse(Decimal arg)
Returns the difference of the argument with given element (result = arg - this).
Specified by:
subtractInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The difference of the argument with given element

subtractInverse

public MatrixElementSet subtractInverse(MatrixElementSet arg)
Returns the difference of the argument with given element (result = arg - this).
Specified by:
subtractInverse in interface ElementSet
Parameters:
arg - The first argument
Returns:
The difference of the argument with given element

tan

public ElementSet tan()
Returns the tangent of given element.
Specified by:
tan in interface ElementSet
Returns:
The tangent of the given element

toFormattedString

public java.lang.String toFormattedString(java.text.DecimalFormat df)
Returns formatted string representing the given element.
Specified by:
toFormattedString in interface ElementSet
Parameters:
df - Formatter
Returns:
The formatted string representing the given element

toString

public java.lang.String toString()
Returns a String that represents the value of this object.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the receiver