Class IntegerToBigIntegerDecorator
- java.lang.Object
-
- com.singularsys.extensions.field.implementations.FieldDecorator
-
- com.singularsys.extensions.field.implementations.IntegerToBigIntegerDecorator
-
- All Implemented Interfaces:
FieldI
,java.io.Serializable
public class IntegerToBigIntegerDecorator extends FieldDecorator
A FieldDecorator which converters Integer/Long/Short to BigIntegers on input, and optionally BigIntegers to Integers on output when there is no loss of precision.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntegerToBigIntegerDecorator(FieldI field)
IntegerToBigIntegerDecorator(FieldI ring, boolean simplifyResults)
If simplifyResults is true any BigInteger result which can be converted to a integer without loss of precision
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
convertInput(java.lang.Object in)
Attempt to convert the input to a Field method.java.lang.Object
convertOutput(java.lang.Object out)
Attempt to convert the output from a Field method.
-
-
-
Constructor Detail
-
IntegerToBigIntegerDecorator
public IntegerToBigIntegerDecorator(FieldI field)
-
IntegerToBigIntegerDecorator
public IntegerToBigIntegerDecorator(FieldI ring, boolean simplifyResults)
If simplifyResults is true any BigInteger result which can be converted to a integer without loss of precision- Parameters:
ring
- base ringsimplifyResults
- whether to try to convert real results back to Doubles.
-
-
Method Detail
-
convertInput
public java.lang.Object convertInput(java.lang.Object in) throws EvaluationException
Description copied from class:FieldDecorator
Attempt to convert the input to a Field method.- Specified by:
convertInput
in classFieldDecorator
- Returns:
- If appropriate convert
in
to a different type, otherwise returnin
. - Throws:
EvaluationException
-
convertOutput
public java.lang.Object convertOutput(java.lang.Object out) throws EvaluationException
Description copied from class:FieldDecorator
Attempt to convert the output from a Field method.- Specified by:
convertOutput
in classFieldDecorator
- Returns:
- If appropriate convert
out
to a different type, otherwise returnout
. - Throws:
EvaluationException
-
-