Interface FieldElement<T>
-
- Type Parameters:
T- the type of the field elements
- All Known Subinterfaces:
RealFieldElement<T>
public interface FieldElement<T>
Interface representing field elements.- Since:
- 2.0
- See Also:
Field
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tadd(T a)Compute this + a.Tdivide(T a)Compute this ÷ a.Field<T>getField()Get theFieldto which the instance belongs.Tmultiply(int n)Compute n × this.Tmultiply(T a)Compute this × a.Tnegate()Returns the additive inverse ofthiselement.Treciprocal()Returns the multiplicative inverse ofthiselement.Tsubtract(T a)Compute this - a.
-
-
-
Method Detail
-
add
T add(T a) throws NullArgumentException
Compute this + a.- Parameters:
a- element to add- Returns:
- a new element representing this + a
- Throws:
NullArgumentException- ifaisnull.
-
subtract
T subtract(T a) throws NullArgumentException
Compute this - a.- Parameters:
a- element to subtract- Returns:
- a new element representing this - a
- Throws:
NullArgumentException- ifaisnull.
-
multiply
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- Number of timesthismust be added to itself.- Returns:
- A new element representing n × this.
-
multiply
T multiply(T a) throws NullArgumentException
Compute this × a.- Parameters:
a- element to multiply- Returns:
- a new element representing this × a
- Throws:
NullArgumentException- ifaisnull.
-
divide
T divide(T a) throws NullArgumentException, MathArithmeticException
Compute this ÷ a.- Parameters:
a- element to divide by- Returns:
- a new element representing this ÷ a
- Throws:
NullArgumentException- ifaisnull.MathArithmeticException- ifais zero
-
reciprocal
T reciprocal() throws MathArithmeticException
Returns the multiplicative inverse ofthiselement.- Returns:
- the inverse of
this. - Throws:
MathArithmeticException- ifthisis zero
-
-