Package org.apfloat.jscience
Class AbstractField<T extends AbstractField<T,V>,V extends Apcomplex>
java.lang.Object
java.lang.Number
org.jscience.mathematics.number.Number<T>
org.apfloat.jscience.AbstractField<T,V>
- Type Parameters:
T- The type of the field.V- The type of the underlying value.
- All Implemented Interfaces:
Serializable,Comparable<T>,Immutable,Realtime,ValueType,XMLSerializable,Field<T>,GroupAdditive<T>,GroupMultiplicative<T>,Ring<T>,Structure<T>
- Direct Known Subclasses:
ApcomplexField,ApfloatField,AprationalField,FixedPrecisionApcomplexField,FixedPrecisionApfloatField,ModuloApintField
public abstract class AbstractField<T extends AbstractField<T,V>,V extends Apcomplex>
extends Number<T>
implements Field<T>
This class represents an arbitrary precision field object.
- Since:
- 1.8.0
- Version:
- 1.8.0
- Author:
- Mikko Tommila
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractField(V value) Constructs a new field object with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this number to another number.abstract Tcopy()Returns a copy of this object.doubleReturns the value of this number as adouble.booleanCompares for equality.inthashCode()Returns the hash code for this number.abstract Tinverse()Returns the multiplicative inverse of this object.booleanisLargerThan(T that) Compares the absolute value of this number with the absolute value of the number specified.longReturns the value of this number as along.abstract Topposite()Returns the additive inverse of this object.abstract TReturns the sum of this object with the one specified.abstract TReturns the product of this object with the one specified.toText()Returns the text representation of this number.value()Returns the value of this number as the underlying type.Methods inherited from class org.jscience.mathematics.number.Number
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toString
-
Constructor Details
-
AbstractField
Constructs a new field object with the specified value.- Parameters:
value- The value.
-
-
Method Details
-
plus
Returns the sum of this object with the one specified.- Specified by:
plusin interfaceGroupAdditive<T extends AbstractField<T,V>> - Parameters:
that- The addend.- Returns:
this + that
-
opposite
Returns the additive inverse of this object.- Specified by:
oppositein interfaceGroupAdditive<T extends AbstractField<T,V>> - Returns:
-this
-
times
Returns the product of this object with the one specified.- Specified by:
timesin interfaceGroupMultiplicative<T extends AbstractField<T,V>> - Specified by:
timesin interfaceRing<T extends AbstractField<T,V>> - Parameters:
that- The multiplicand.- Returns:
this * that
-
inverse
Returns the multiplicative inverse of this object.- Specified by:
inversein interfaceGroupMultiplicative<T extends AbstractField<T,V>> - Returns:
1 / this- Throws:
ArithmeticException- If the divisor is zero.
-
copy
-
isLargerThan
Compares the absolute value of this number with the absolute value of the number specified.- Specified by:
isLargerThanin classNumber<T extends AbstractField<T,V>> - Parameters:
that- The number to be compared with.- Returns:
|this| > |that|
-
value
-
doubleValue
public double doubleValue()Returns the value of this number as adouble.- Specified by:
doubleValuein classNumber<T extends AbstractField<T,V>> - Returns:
- The value.
-
longValue
-
toText
-
compareTo
Compares this number to another number.- Specified by:
compareToin interfaceComparable<T extends AbstractField<T,V>> - Specified by:
compareToin classNumber<T extends AbstractField<T,V>> - Parameters:
that- The number to be compared with.- Returns:
- -1, 0, or 1 depending on the ordering.
-
hashCode
-
equals
-