Class GenericPowerField<E>
- java.lang.Object
-
- com.singularsys.extensions.field.implementations.AbstractComparativeField
-
- com.singularsys.extensions.field.implementations.GenericField<E>
-
- com.singularsys.extensions.field.implementations.GenericPowerField<E>
-
- Type Parameters:
E
- Basic type field uses, e.g. Double or Complex.
- All Implemented Interfaces:
FieldI
,IntegerConvertor
,java.io.Serializable
- Direct Known Subclasses:
ExactIntegerField
,LongField
,RationalField
,ShortField
public abstract class GenericPowerField<E> extends GenericField<E>
Provides a standardE powI(E l, Integer r)
method for integer powers. Subclasses must implementInteger convertToInt(Object l)
- Author:
- Richard Morris
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenericPowerField(E zero, E one)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description E
powG(E l, E r)
If r is integral (convertToInt returns non-null) call powI otherwise call powNIprotected E
powI(E l, java.lang.Integer r)
abstract E
powNonInt(E l, E r)
Called when the power is not an integer-
Methods inherited from class com.singularsys.extensions.field.implementations.GenericField
add, addG, and, cast, cmp, cmpG, convertFromInt, convertToInt, convertToIntE, div, divG, getOne, getZero, mod, modG, mul, mulG, neg, negG, not, or, pow, sub, subG
-
-
-
-
Method Detail
-
powG
public E powG(E l, E r) throws EvaluationException
If r is integral (convertToInt returns non-null) call powI otherwise call powNI- Specified by:
powG
in classGenericField<E>
- Parameters:
l
- lhs argumentr
- rhs argument- Returns:
- the power
- Throws:
EvaluationException
- on error
-
powNonInt
public abstract E powNonInt(E l, E r) throws EvaluationException
Called when the power is not an integer- Parameters:
l
-r
-- Returns:
- Throws:
EvaluationException
-
powI
protected E powI(E l, java.lang.Integer r) throws EvaluationException
- Throws:
EvaluationException
-
-