Top Description Methods
org.apache.commons.math3

public Interface FieldElement<T>

Known Direct Subinterfaces
org.apache.commons.math3.RealFieldElement
Known Direct Implementers
org.apache.commons.math3.complex.Complex, org.apache.commons.math3.fraction.BigFraction, org.apache.commons.math3.fraction.Fraction, org.apache.commons.math3.util.BigReal
Type Parameters
<T>
the type of the field elements
Imports
org.apache.commons.math3.exception.MathArithmeticException, .NullArgumentException

Interface representing field elements.
Since
2.0
See Also
Field

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

a new element representing this + a
add
(T
element to add
a
)

Compute this + a.

public T

Returns:

a new element representing this ÷ a
divide
(T
element to divide by
a
)

Compute this ÷ a.

public Field<T>

Returns:

Field to which the instance belongs
getField
()

Get the Field to which the instance belongs.

public T

Returns:

A new element representing n × this.
multiply
(int
Number of times this must be added to itself.
n
)

Compute n × this.</center>

public T

Returns:

a new element representing this × a
multiply
(T
element to multiply
a
)

Compute this × a.

public T

Returns:

the opposite of this.
negate
()

Returns the additive inverse of this element.

public T

Returns:

the inverse of this.
reciprocal
()

Returns the multiplicative inverse of this element.

public T

Returns:

a new element representing this - a
subtract
(T
element to subtract
a
)

Compute this - a.

Method Detail

addback to summary
public T add(T a) throws NullArgumentException

Compute this + a.

Parameters
a:T

element to add

Returns:T

a new element representing this + a

Exceptions
NullArgumentException:
if a is null.
divideback to summary
public T divide(T a) throws NullArgumentException, MathArithmeticException

Compute this ÷ a.

Parameters
a:T

element to divide by

Returns:T

a new element representing this ÷ a

Exceptions
NullArgumentException:
if a is null.
MathArithmeticException:
if a is zero
getFieldback to summary
public Field<T> getField()

Get the Field to which the instance belongs.

Returns:Field<T>

Field to which the instance belongs

multiplyback to summary
public T multiply(int n)

Compute n × this. Multiplication by an integer number is defined as the following sum

n × this = ∑i=1n this.
Parameters
n:int

Number of times this must be added to itself.

Returns:T

A new element representing n × this.

multiplyback to summary
public T multiply(T a) throws NullArgumentException

Compute this × a.

Parameters
a:T

element to multiply

Returns:T

a new element representing this × a

Exceptions
NullArgumentException:
if a is null.
negateback to summary
public T negate()

Returns the additive inverse of this element.

Returns:T

the opposite of this.

reciprocalback to summary
public T reciprocal() throws MathArithmeticException

Returns the multiplicative inverse of this element.

Returns:T

the inverse of this.

Exceptions
MathArithmeticException:
if this is zero
subtractback to summary
public T subtract(T a) throws NullArgumentException

Compute this - a.

Parameters
a:T

element to subtract

Returns:T

a new element representing this - a

Exceptions
NullArgumentException:
if a is null.