T
- The type of the field.V
- The type of the underlying value.public abstract class AbstractField<T extends AbstractField<T,V>,V extends Apcomplex> extends Number<T> implements Field<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractField(V value)
Constructs a new field object with the specified value.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(T that)
Compares this number to another number.
|
abstract T |
copy()
Returns a copy of this object.
|
double |
doubleValue()
Returns the value of this number as a
double . |
boolean |
equals(Object obj)
Compares for equality.
|
int |
hashCode()
Returns the hash code for this number.
|
abstract T |
inverse()
Returns the multiplicative inverse of this object.
|
boolean |
isLargerThan(T that)
Compares the absolute value of this number
with the absolute value of the number specified.
|
long |
longValue()
Returns the value of this number as a
long . |
abstract T |
opposite()
Returns the additive inverse of this object.
|
abstract T |
plus(T that)
Returns the sum of this object with the one specified.
|
abstract T |
times(T that)
Returns the product of this object with the one specified.
|
Text |
toText()
Returns the text representation of this number.
|
V |
value()
Returns the value of this number as the underlying type.
|
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toString
protected AbstractField(V value)
value
- The value.public abstract T plus(T that)
plus
in interface GroupAdditive<T extends AbstractField<T,V>>
that
- The addend.this + that
public abstract T opposite()
opposite
in interface GroupAdditive<T extends AbstractField<T,V>>
-this
public abstract T times(T that)
times
in interface GroupMultiplicative<T extends AbstractField<T,V>>
times
in interface Ring<T extends AbstractField<T,V>>
that
- The multiplicand.this * that
public abstract T inverse() throws ArithmeticException
inverse
in interface GroupMultiplicative<T extends AbstractField<T,V>>
1 / this
ArithmeticException
- If the divisor is zero.public abstract T copy()
public boolean isLargerThan(T that)
isLargerThan
in class Number<T extends AbstractField<T,V>>
that
- The number to be compared with.|this| > |that|
public V value()
public double doubleValue()
double
.doubleValue
in class Number<T extends AbstractField<T,V>>
public long longValue()
long
.public Text toText()
public int compareTo(T that)
compareTo
in interface Comparable<T extends AbstractField<T,V>>
compareTo
in class Number<T extends AbstractField<T,V>>
that
- The number to be compared with.public int hashCode()