Class IntegerToBigIntegerDecorator

java.lang.Object
com.singularsys.extensions.field.implementations.FieldDecorator
com.singularsys.extensions.field.implementations.IntegerToBigIntegerDecorator
All Implemented Interfaces:
FieldI, IntegerConvertor, 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:
  • Constructor Details

    • IntegerToBigIntegerDecorator

      public IntegerToBigIntegerDecorator(FieldI field)
    • IntegerToBigIntegerDecorator

      public IntegerToBigIntegerDecorator(FieldI ring, boolean simplifyResults)
      If simplifyResults is true any BigInteger result which can be converted to an integer without loss of precision
      Parameters:
      ring - base ring
      simplifyResults - whether to try to convert real results back to Doubles.
  • Method Details

    • convertInput

      public Object convertInput(Object in)
      Description copied from class: FieldDecorator
      Attempt to convert the input to a Field method.
      Specified by:
      convertInput in class FieldDecorator
      Parameters:
      in -
      Returns:
      If appropriate convert in to a different type, otherwise return in.
    • convertOutput

      public Object convertOutput(Object out)
      Description copied from class: FieldDecorator
      Attempt to convert the output from a Field method.
      Specified by:
      convertOutput in class FieldDecorator
      Parameters:
      out -
      Returns:
      If appropriate convert out to a different type, otherwise return out.