org.apache.commons.math
Interface FieldElement<T>

Type Parameters:
T - the type of the field elements
All Known Implementing Classes:
BigFraction, BigReal, Complex, Dfp, DfpDec, Fraction

public interface FieldElement<T>

Interface representing field elements.

Since:
2.0
Version:
$Revision: 811685 $ $Date: 2009-09-05 19:36:48 +0200 (sam. 05 sept. 2009) $
See Also:
Field

Method Summary
 T add(T a)
          Compute this + a.
 T divide(T a)
          Compute this ÷ a.
 Field<T> getField()
          Get the Field to which the instance belongs.
 T multiply(T a)
          Compute this × a.
 T subtract(T a)
          Compute this - a.
 

Method Detail

add

T add(T a)
Compute this + a.

Parameters:
a - element to add
Returns:
a new element representing this + a

subtract

T subtract(T a)
Compute this - a.

Parameters:
a - element to subtract
Returns:
a new element representing this - a

multiply

T multiply(T a)
Compute this × a.

Parameters:
a - element to multiply
Returns:
a new element representing this × a

divide

T divide(T a)
         throws ArithmeticException
Compute this ÷ a.

Parameters:
a - element to add
Returns:
a new element representing this ÷ a
Throws:
ArithmeticException - if a is the zero of the additive operation (i.e. additive identity)

getField

Field<T> getField()
Get the Field to which the instance belongs.

Returns:
Field to which the instance belongs


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.