Class NumberBuilder

java.lang.Object
com.singularsys.extensions.mathml.builder.NumberBuilder
All Implemented Interfaces:
MathMLFragmentBuilder

public class NumberBuilder extends Object implements MathMLFragmentBuilder
Converts numeric-constants to CN nodes. Can produce
  • <cn type="integer">value</cn> if is an Integer, Long or Short
  • <cn type="e-notation">mantissa<sep/>exponent</cn> if Double.toString(val) produces scientific notation.
  • <cn type="complex-cartesian">real<sep/>imaginary</cn> if the value is complex
  • <notanumber/> for Doubles representing NaN's
  • <infinity/> for Doubles representing +Infinity
  • <apply><minus><infinity/><apply/> for Doubles representing -Infinity
  • <cn type="integer">value</cn> for all other types
  • <cn>value</cn> for all other types
The format of Double values with integral values depends on the doubleBehaviour flag
  • ALLWAYS_DOUBLE <cn>2.0</cn>
  • NO_DECIMALPOINT <cn>2</cn>
  • TYPE_INTEGER <cn type="integer">2</cn>
Author:
Richard Morris